archetypes
archetypes copied to clipboard
Upgrade tests to use JUnit5
It should be considered best practice to start plugin development using JUnit5 over JUnit4.
org.junit.*imports being updated to JUnit5 equivalents- Use
@WithJenkinsin combination withJenkinsRule - Make test classes and methods package-private (convention for JUnit5)
I'm not 100% convinced that I migrated SampleConfigurationTest correctly since I was not able to find a proper equivalent for JenkinsSessionRule - maybe @basil could confirm if the test still covers the intended functionality.
Testing done
Ran mvn clean verify without errors.
### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [ ] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue
@basil Thanks for checking. I will look into it and try to find a proper solution. I was a little put off by the assertion stating "still there after restart of Jenkins" but now I know what’s supposed to happen.