fabric8io / kubernetes-client

Java client for Kubernetes & OpenShift
http://fabric8.io
Apache License 2.0
3.42k stars 1.46k forks source link

Remove JUnit5 `org.junit.jupiter:junit-jupiter-migrationsupport` dependency from codebase #5141

Closed rohanKanojia closed 1 year ago

rohanKanojia commented 1 year ago

Is your task related to a problem? Please describe

We seem to be including this dependency in most of our poms: https://github.com/fabric8io/kubernetes-client/blob/c76762a58d809d47d5a36734a096eeb74e474f7d/pom.xml#L837-L841

I think it was added during JUnit5 refactor to maintain compatibility with JUnit4 @Rule, when mockserver had to be used with a @Rule. But now that we've migrated to JUnit5 extension @EnableKubernetesMockServer. This dependency should not be required.

I only see one place where we're using @Rule in a JUnit5 test, but it can easily be replaced with @TempDir JUnit5 annotation: https://github.com/fabric8io/kubernetes-client/blob/c76762a58d809d47d5a36734a096eeb74e474f7d/uberjar/src/test/java/io/fabric8/kubernetes/clnt/UberJarTest.java#L49-L50

You can find all the occurrences of this dependency by searching for junit-jupiter-migrationsupport in project.

Describe the solution you'd like

Remove all occurrences of org.junit.jupiter:junit-jupiter-migrationsupport dependency. For most places, it should be as trivial as removing the dependency from pom.

Describe alternatives you've considered

No response

Additional context

No response

akshayamadhuri commented 1 year ago

can i work on this

akshayamadhuri commented 1 year ago

@rohanKanojia after removing the org.junit.jupiter:junit-jupiter-migrationsupport dependency I got an error with the Maven test

rohanKanojia commented 1 year ago

@akshaya-hub : Are you getting error in UberJarTest? You can try replacing TemporaryFolder Rule there with @TempDir annotation.

akshayamadhuri commented 1 year ago

@rohanKanojia ok i will try