Convert tests from TestNG to JUnit 5#4259
Merged
Merged
Conversation
73ec4a8 to
8ed6edf
Compare
bcfc6c1 to
63d2fed
Compare
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.
Summary
@BeforeEach,@AfterEach,@BeforeAll,@AfterAll,@Disabled,@Tag,@DisplayName,@ParameterizedTest,@MethodSource)assertEquals/assertNotEqualsargument order from TestNG convention(actual, expected)to JUnit 5 convention(expected, actual)@DataProvidermethods tostatic Stream<Arguments>withArguments.of(...)rowsexpectedExceptionstest bodies inassertThrows()blocksthrow new SkipException(...)withAssumptions.assumeTrue(false, ...)@TestInstance(Lifecycle.PER_CLASS)toTemplatedTestBaseso@AfterAllworks on instance methods (annotation is@Inherited, covers all 261 subclasses)TemplatedTestBase.validateTestName()to read@DisplayNameinstead of TestNG's@Test.testName()assertEquals(double[], double[], delta)→assertArrayEqualsinDoubleMappingTest/FloatMappingTest@Testannotations; add@Testto individual test methods where neededpom.xmlfiles: remove TestNG dependency, add JUnit Jupiter 5.11.4 + params<useModulePath>false</useModulePath>to maven-surefire-pluginTest plan
./mvnw install -pl :morphia-core -DskipTestscompiles cleanly./mvnw test -pl :morphia-core -Dtest="TypesTest"passes (44 parameterized tests)./mvnw install -pl :examples -DskipTestscompiles cleanly./mvnw install -pl :morphia-validation -DskipTestscompiles cleanly./mvnw install -pl :morphia-kotlin -DskipTestscompiles cleanlyhttps://claude.ai/code/session_01FHUBbAt2yQbG2nB5fNwsnz
Generated by Claude Code