Skip to content

Never reorder classes annotated with @FixMethodOrder - #1638

Merged
marcphilipp merged 2 commits into
junit-team:masterfrom
kcooney:issue1637
Nov 27, 2019
Merged

Never reorder classes annotated with @FixMethodOrder#1638
marcphilipp merged 2 commits into
junit-team:masterfrom
kcooney:issue1637

Conversation

@kcooney

@kcooney kcooney commented Nov 19, 2019

Copy link
Copy Markdown
Member

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

kcooney commented Nov 21, 2019

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
Copy Markdown
Member

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

@kcooney

kcooney commented Nov 28, 2019

Copy link
Copy Markdown
Member Author

@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