-
Notifications
You must be signed in to change notification settings - Fork 1
DBT-401 update unit tests to Junit 5 #305
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
DBT-401 update unit tests to Junit 5 #305
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef30f85088
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <dependency> | ||
| <groupId>org.junit.vintage</groupId> | ||
| <artifactId>junit-vintage-engine</artifactId> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-api</artifactId> | ||
| <scope>test</scope> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add JUnit Jupiter engine so tests actually run
This POM now only declares junit-jupiter-api, which is compile-time only; without junit-jupiter-engine (or another JUnit 5 provider configured elsewhere), Maven Surefire won’t discover/run any JUnit 5 tests. I couldn’t find any junit-jupiter-engine/junit-platform dependency in this repo, so CI can start “passing” while silently skipping tests unless the parent POM supplies the engine.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the test suite from JUnit 4 to JUnit 5 (Jupiter). The migration updates test classes to use JUnit 5 annotations, assertion methods, and the MyCoRe test framework's JUnit 5 support.
Changes:
- Replaced JUnit 4 dependency with JUnit 5 Jupiter dependencies in pom.xml
- Migrated all test classes from JUnit 4 annotations (@before, @test from org.junit) to JUnit 5 equivalents (@beforeeach, @test from org.junit.jupiter.api)
- Replaced static assertion imports and calls (Assert.assertEquals) with JUnit 5 Assertions class (Assertions.assertEquals)
- Updated base test classes from MCRTestCase/MCRJPATestCase to use @MyCoReTest annotation and appropriate extensions (@ExtendWith)
- Migrated test configuration from getTestProperties() method to declarative @MCRTestConfiguration annotations
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Removed JUnit 4 dependency, added JUnit 5 Jupiter API and engine dependencies |
| TestEntityFactory.java | Migrated from MCRTestCase to @MyCoReTest, updated assertions and configuration approach |
| JerseyTestCase.java | Updated to use @MyCoReTest with @ExtendWith(MCRMetadataExtension.class), removed JUnit 4 setup methods |
| TestSlotEntry.java | Migrated from MCRTestCase to @MyCoReTest, updated assertions to use Assertions class |
| TestSlot.java | Migrated from MCRJPATestCase to @MyCoReTest with JPA and Metadata extensions, updated transaction management |
| TestRCResource.java | Added @ExtendWith(MCRJPAExtension.class), updated to use JUnit 5 static imports |
| TestRCCalendar.java | Migrated from MCRTestCase to @MyCoReTest, updated assertions |
| TestPeriod.java | Migrated from MCRTestCase to @MyCoReTest, updated assertions |
| DBTMapObjectIDURNGeneratorTest.java | Migrated from MCRTestCase to @MyCoReTest, updated configuration approach |
| TestOPCResource.java | Added @MCRTestConfiguration annotation, but changed configuration key (potential issue) |
| TestOPCResolver.java | Migrated from MCRTestCase to @MyCoReTest, updated assertions |
| TestOPCConnector.java | Migrated from MCRTestCase to @MyCoReTest, updated assertions |
| TestMediaServiceResource.java | Updated to use JUnit 5 imports and annotations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* 2025.06.x: DBT-401 update unit tests to Junit 5 (#305)
No description provided.