Repository navigation
Move the tests that do not use the plugin testing harness to JUnit 5 and off Hamcrest - #1422
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1414. Thirteen test classes in
versions-maven-pluginuse plain JUnit 4 and now use JUnit 5; the module getsjunit-jupiter-apilikeversions-commonhas. None of them passes a message as the first argument of an assertion, so the argument order is unchanged.The same classes no longer use Hamcrest.
equalTo,is,instanceOf,nullValueandemptybecome the matchingAssertionsmethods. The text matchers have no JUnit counterpart, soTextAssertionsaddsassertContains,assertNotContains,assertContainsInOrder,assertMatches(the whole text, asmatchesPatterndid) andassertAnyLineContains, each printing the text it checked when it fails.The other 27 JUnit 4 classes use
AbstractMojoTestCaseandMojoRule, the deprecated classes CI warns about, and keep JUnit 4 and Hamcrest for now: the JUnit 5MojoExtensionof the harness gives the mojo an emptyMavenProjectinstead of building the POM, so those tests need a helper that builds the project first. That comes next under #1414, and the vintage engine and Hamcrest go once they move.Verified:
mvn -pl versions-maven-plugin install -Dinvoker.skipโ 297 tests, the same count as on master, 0 failures, 0 Checkstyle violations; changing an expected value forassertContains,assertNotContainsandassertContainsInOrdermakes each fail with the checked text