Skip to content

refactor: Resolve open SonarCloud issues#112

Merged
thced merged 1 commit into
masterfrom
chore/sonar-open-issues
Jul 2, 2026
Merged

refactor: Resolve open SonarCloud issues#112
thced merged 1 commit into
masterfrom
chore/sonar-open-issues

Conversation

@thced

@thced thced commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Resolves the open issues reported on the SonarCloud default branch (extenda_openapi-httpserver-java).

What

Rule Count Fix
java:S8714 54 Replace try/catch + fail() with assertDoesNotThrow(...) in OpenApiServerIT and ServerBaseTest (all 28 IT blocks converted, 2 of which Sonar had not yet flagged).
java:S8694 3 Use java.time.Month constants instead of int month literals in GsonJsonMapperTest.
java:S109 2 Name the 4xx status bounds (MIN/MAX_CLIENT_ERROR_STATUS) in BadRequestException.
java:S8433 1 Validate the status range before super() via a flexible constructor body (JEP 513).

Notes

  • No behaviour change. The changes are test-only refactors plus an equivalent constructor reordering already covered by BadRequestExceptionTest (invalid-status and null-detail paths).
  • mvn verify is green locally: 534 unit tests + 68 IT, 0 failures.

Clear the open issues reported on the default branch:

- java:S8714 (assertDoesNotThrow): replace try/catch + fail() blocks in
  OpenApiServerIT and ServerBaseTest with assertDoesNotThrow(...).
- java:S8694 (Month enum): use java.time.Month constants in
  GsonJsonMapperTest instead of int month literals.
- java:S109 (magic numbers): name the 4xx status bounds in
  BadRequestException (MIN/MAX_CLIENT_ERROR_STATUS).
- java:S8433 (validation before super()): validate the status range
  before the super() call using a flexible constructor body.

No behaviour change; test-only refactors plus an equivalent constructor
reordering covered by BadRequestExceptionTest.
@thced thced force-pushed the chore/sonar-open-issues branch from 5a2930c to 507b908 Compare July 2, 2026 16:28
@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@thced thced merged commit 368e3c1 into master Jul 2, 2026
6 checks passed
@thced thced deleted the chore/sonar-open-issues branch July 2, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant