-
Notifications
You must be signed in to change notification settings - Fork 147
Migrate tests to JUnit5 #346
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
base: master
Are you sure you want to change the base?
Migrate tests to JUnit5 #346
Conversation
488aad2 to
11ff389
Compare
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.
This test was not migrated to JUnit5.
While it would be possible the combination of JenkinsConfiguredWithCodeRule and Envs / Env / EnvsFromFile makes it rather tricky and would require further changes to the tests. As I can not be sure that this would not change the intent of a test, I decided to leave it out of the migration.
* Migrate annotations and imports * Migrate assertions * Remove public visibility for test classes and methods * Minor code cleanup
11ff389 to
82079ee
Compare
|
@jenkinsci/hashicorp-vault-plugin-developers Kindly requesting a review. |
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 existing test suite from JUnit4 to JUnit5, updates related imports and annotations, and cleans up test utility classes.
- Converted test classes and lifecycle methods to JUnit Jupiter annotations
- Replaced interface-based constant usage with static imports in utility classes
- Updated project POM to include JUnit Jupiter and Testcontainers JUnit support
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| VaultTestUtil.java | Updated VaultContainer generics and replaced interface-based constants with static imports |
| VaultContainer.java | Updated Javadoc for lifecycle hook and replaced deprecated Testcontainers API calls |
| TestConstants.java | Centralized new constants for JUnit5 tests |
| MaskingConsoleLogFilterSpec.java | Switched to JUnit5 with MockitoExtension and updated annotations |
| VaultSecretSourceTest.java | Partial JUnit5 migration; still contains JUnit4 rules and lifecycle annotations |
| pom.xml | Added Testcontainers JUnit Jupiter dependency and switched Mockito to JUnit Jupiter |
Comments suppressed due to low confidence (1)
src/test/java/com/datapipe/jenkins/vault/jcasc/secrets/VaultSecretSourceTest.java
Show resolved
Hide resolved
src/test/java/com/datapipe/jenkins/vault/jcasc/secrets/VaultSecretSourceTest.java
Show resolved
Hide resolved
dineshba
left a comment
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.
Thanks for this PR @strangelookingnerd. LGTM
This PR aims to migrate all tests to JUnit5. Changes include:
I am well aware that this is a quite large changeset however I hope that there is still interest in this PR and it will be reviewed.
If there are any questions, please do not hesitate to ping me.