Skip to content

Introduce SpringTestRules Refaster rule collection #1621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Stephan202
Copy link
Member

@Stephan202 Stephan202 commented Mar 29, 2025

Suggested commit message:

Introduce `SpringTestRules` Refaster rule collection (#1621)

Opening this as a draft PR, because I can't get the build to pass: despite the @SuppressWarnings("deprecation") annotations, warnings are emitted, in duplicate. I suspect that there's an interesting interaction with the annotation processors/compiler plugins, but that's TBD.

@Stephan202 Stephan202 force-pushed the sschroevers/introduce-SpringTestRules branch from cd0fb91 to 6c8f11f Compare March 29, 2025 20:25
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Comment on lines +27 to +29
BodyContentSpec after(BodyContentSpec spec, String expectedJson) {
return spec.json(expectedJson, JsonCompareMode.LENIENT);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative to write it to the overload that does this by default:

Suggested change
BodyContentSpec after(BodyContentSpec spec, String expectedJson) {
return spec.json(expectedJson, JsonCompareMode.LENIENT);
}
BodyContentSpec after(BodyContentSpec spec, String expectedJson) {
return spec.json(expectedJson);
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's up for debate, indeed. As the Javadoc indicates, personally I feel this is a case where it's better to be explicit, because the default behavior is IMHO surprising / less strict than I'd have assumed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants