-
Notifications
You must be signed in to change notification settings - Fork 77
Migrate tests to JUnit5 #162
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 #162
Conversation
* Migrate annotations and imports * Migrate assertions * Remove public visibility for test classes and methods * Minor code cleanup
import org.jvnet.hudson.test.JenkinsRule; | ||
import org.jvnet.hudson.test.junit.jupiter.WithJenkins; | ||
|
||
class JCasCTest { |
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.
Why the rename?
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.
Mhh, I think it was mainly to satisfy my inner Monk. It's the "official" naming, isn't it? Most similar implementations in other plugins are named the same way.
.grant(Jenkins.READ).everywhere().to("alice", "bob") | ||
.grant(Computer.BUILD).everywhere().to("alice", "bob") | ||
.grant(Jenkins.READ) | ||
.everywhere() | ||
.to("alice", "bob") | ||
.grant(Computer.BUILD) | ||
.everywhere() | ||
.to("alice", "bob") |
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 sort of gratuitous reformatting makes it harder to review changes. Is this imposed by a limitation of some automated tool?
# Conflicts: # src/test/java/org/jenkinsci/plugins/docker/commons/credentials/DockerServerEndpointTest.java # src/test/java/org/jenkinsci/plugins/docker/commons/impl/HostOnlyRegistryKeyMaterialFactoryTest.java # src/test/java/org/jenkinsci/plugins/docker/commons/impl/RegistryKeyMaterialFactoryTest.java # src/test/java/org/jenkinsci/plugins/docker/commons/util/SampleDockerBuilder.java
This PR aims to migrate all tests to JUnit5. Changes include:
There are two exceptions where tests use rules that have not yet been migrated to JUnit5:
DockerServerCredentialsBindingTest
usingJenkinsSessionRule
(migrated fromRestartableJenkinsRule
)DockerServerCredentialsHandlerTest
usingJenkinsSessionRule
(migrated fromRestartableJenkinsRule
)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.