Migrate tests to JUnit5
This PR aims to migrate all tests to JUnit5. Changes include:
- Migrate annotations and imports
- Migrate assertions
- Migrate GHMock from
RuletoExtension - Migrate
DataProviderRunnertoParameterizedTest - Remove public visibility for test classes and methods
- Minor clean up
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.
- [x] Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
for which there is no JUnit5 equivalent
That's why junit5 was not used. What is the goal at all of doing this?
That's why junit5 was not used.
As I wrote its not available yet, but will be once https://github.com/jenkinsci/jenkins-test-harness/pull/900 is being delivered via a newer plugin-pom version.
What is the goal at all of doing this?
In general I'd say it's a good practice to not rely on outdated libraries - even for testing. This PR removes one of these outdated libraries (com.tngtech.java:junit-dataprovider) entirely and updates another one to a more recent and therefore supported and maintained version (com.github.tomakehurst:wiremock-jre8-standalone).
Upgrading from JUnit4 to 5 not only brings some advantages in usage and features but also makes the test implementations not depend on a framework version that is no longer maintained.
@jenkinsci/github-plugin-developers Kindly requesting a review.