Skip to content

fix(test): Hoist schema construction out of assertThatThrownBy lambdas#57

Merged
thced merged 1 commit into
masterfrom
fix/sonar-s5778-lambda-single-invocation
May 18, 2026
Merged

fix(test): Hoist schema construction out of assertThatThrownBy lambdas#57
thced merged 1 commit into
masterfrom
fix/sonar-s5778-lambda-single-invocation

Conversation

@thced

@thced thced commented May 18, 2026

Copy link
Copy Markdown
Contributor

Sonar java:S5778 wants exactly one possibly-throwing invocation inside the lambda passed to assertThatThrownBy, so it can attribute the thrown exception unambiguously. Extract the schema constructor (or helper call) to a local before the assertion.

Affects 7 occurrences across DefaultValidatorDispatchTest and ValidatorNoThrowOnHappyPathTest.

Sonar java:S5778 wants exactly one possibly-throwing invocation inside
the lambda passed to assertThatThrownBy, so it can attribute the thrown
exception unambiguously. Extract the schema constructor (or helper call)
to a local before the assertion.

Affects 7 occurrences across DefaultValidatorDispatchTest and
ValidatorNoThrowOnHappyPathTest.
@thced thced force-pushed the fix/sonar-s5778-lambda-single-invocation branch from 3f1d607 to f2269cf Compare May 18, 2026 09:11
@sonarqubecloud

Copy link
Copy Markdown

@thced thced merged commit 65e8339 into master May 18, 2026
4 checks passed
@thced thced deleted the fix/sonar-s5778-lambda-single-invocation branch May 18, 2026 09:18
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