Skip to content
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

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

Closed
rohanKanojia opened this issue May 17, 2023 · 4 comments · Fixed by #5187
Closed
Labels
good first issue Easy hack; Good issue for new contributors technical-debt test

Comments

@rohanKanojia
Copy link
Member

Is your task related to a problem? Please describe

We seem to be including this dependency in most of our poms:

kubernetes-client/pom.xml

Lines 837 to 841 in c76762a

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-migrationsupport</artifactId>
<version>${junit.version}</version>
<scope>test</scope>

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:

@Rule
public TemporaryFolder folder = new TemporaryFolder();

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
Copy link

can i work on this

@akshayamadhuri
Copy link

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

@rohanKanojia
Copy link
Member Author

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

@akshayamadhuri
Copy link

@rohanKanojia ok i will try

@rohanKanojia rohanKanojia mentioned this issue May 18, 2023
11 tasks
@manusa manusa added technical-debt good first issue Easy hack; Good issue for new contributors labels May 30, 2023
This was referenced May 30, 2023
degant added a commit to degant/kubernetes-client that referenced this issue May 31, 2023
@manusa manusa added the test label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Easy hack; Good issue for new contributors technical-debt test
Projects
None yet
3 participants