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

fix #5141: remove junit5 junit-jupiter-migrationsupport dependency from codebase #5187

Merged
merged 5 commits into from
Jun 6, 2023

Conversation

degant
Copy link
Contributor

@degant degant commented May 31, 2023

Description

Fixes #5141

Fixing issue #5141, removing junit-jupiter-migrationsupport and migrating various junit4 references to junit5

  • Removed all references to junit-jupiter-migrationsupport from various pom.xml files (total 36)
  • Modified UberJarTest to use @TempDir instead of rules.
  • Migrated most org.junit.Assert references to the newer org.junit.jupiter.api.Assertions
  • Migrated 2 tests from the older org.junit.After / Before / Test to the newer org.junit.jupiter.api.AfterEach / BeforeEach / Test

The only thing pending is the org.junit.Test and org.junit.Assert refernces remaining in karaf\itests which I couldn't complete.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@degant
Copy link
Contributor Author

degant commented May 31, 2023

@manusa @rohanKanojia @shawkins please take a look when you get a chance.

There are references to org.junit.rules.ExternalResource in KubernetesServer and OpenShiftServer. I have removed the use of KubernetesServer and moved to @EnableKubernetesMockClient in KubernetesAttributesExtractorTest. And OpenShiftServer didn't have any usage already. Do we need to delete these two? Let me know if you have any other suggestions

@rohanKanojia
Copy link
Member

@degant: Thanks a lot for your PR 👍

There are references to org.junit.rules.ExternalResource in KubernetesServer and OpenShiftServer. I have removed the use of KubernetesServer and moved to @EnableKubernetesMockClient in KubernetesAttributesExtractorTest. And OpenShiftServer didn't have any usage already. Do we need to delete these two? Let me know if you have any other suggestions

Scope of this issue is just to remove junit-jupiter-migrationsupport dependency. Your changes look okay to me.

@rohanKanojia
Copy link
Member

@degant : There are some minor code smells reported by Sonar. Could you please address them whenever you revisit this?

@degant
Copy link
Contributor Author

degant commented Jun 1, 2023

@rohanKanojia I assumed that the sonar report was unrelated to my changes. Addressed those as well

@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@manusa manusa added this to the 6.7.1 milestone Jun 6, 2023
@manusa manusa merged commit 33459d3 into fabric8io:master Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove JUnit5 org.junit.jupiter:junit-jupiter-migrationsupport dependency from codebase
3 participants