Skip to content
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

Never reorder classes annotated with @FixMethodOrder #1638

Merged
merged 2 commits into from
Nov 27, 2019

Conversation

kcooney
Copy link
Member

@kcooney kcooney commented Nov 19, 2019

Fixes #1637

This is needed because classes annotated with @FixMethodOrder will not
be reordered or sorted, so having both annotations is a contradiction.

- Add AnnotationValidator to fail if class annotated with @FixMethodOrder
- Annotate OrderWith with @ValidateWith(OrderWithValidator.class)
- Add tests for the new validator
@kcooney
Copy link
Member Author

kcooney commented Nov 21, 2019

Thanks for the review, @marcphilipp

I spit the commit into this pull into two (the first commit containing the changes to sorting/ordering, the second commit adding the validation check).

I suggest using "Create a merge commit" (and not "Squash and merge") for this pull but it's up to you.

@stefanbirkner any concerns with these changes?

@marcphilipp
Copy link
Member

I'd use "Rebase and merge" which would also preserve both commits but avoid the additional merge commit.

@marcphilipp marcphilipp added this to the 4.13-rc-2 milestone Nov 27, 2019
@marcphilipp marcphilipp merged commit b51fa17 into junit-team:master Nov 27, 2019
@marcphilipp
Copy link
Member

Thanks, @kcooney! Could you please add an entry to the release notes?

@kcooney
Copy link
Member Author

kcooney commented Nov 28, 2019

@marcphilipp Done.

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.

sortWith() and orderWith() should respect @FixMethodOrder
3 participants