From a60d18287c39205573effc48bd95ea764e9ac369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Boss=C3=A9?= Date: Thu, 6 Apr 2023 15:02:24 +0200 Subject: [PATCH 1/4] :heavy_minus_sign: Remove unused junit dependency --- java-plugin/pom.xml | 6 ------ javascript-plugin/pom.xml | 14 -------------- php-plugin/pom.xml | 7 ------- pom.xml | 15 --------------- python-plugin/pom.xml | 6 ------ 5 files changed, 48 deletions(-) diff --git a/java-plugin/pom.xml b/java-plugin/pom.xml index 6e5e11f38..88ba0c619 100644 --- a/java-plugin/pom.xml +++ b/java-plugin/pom.xml @@ -69,12 +69,6 @@ test - - org.junit.jupiter - junit-jupiter-migrationsupport - test - - org.assertj assertj-core diff --git a/javascript-plugin/pom.xml b/javascript-plugin/pom.xml index 8412187ea..fbe0800be 100644 --- a/javascript-plugin/pom.xml +++ b/javascript-plugin/pom.xml @@ -38,20 +38,6 @@ sonar-analyzer-commons - - - - junit - junit - test - - - - org.assertj - assertj-core - test - - diff --git a/php-plugin/pom.xml b/php-plugin/pom.xml index a79f181ef..0180065c8 100644 --- a/php-plugin/pom.xml +++ b/php-plugin/pom.xml @@ -40,18 +40,11 @@ - - junit - junit - test - - org.assertj assertj-core test - diff --git a/pom.xml b/pom.xml index 83d26a01e..c778ffec3 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,6 @@ 1.21.0.505 true 3.4.1 - 4.13.2 5.9.1 3.23.1 @@ -156,13 +155,6 @@ test - - org.junit.jupiter - junit-jupiter-migrationsupport - ${junit.jupiter.version} - test - - org.assertj assertj-core @@ -170,13 +162,6 @@ test - - junit - junit - ${junit.version} - test - - org.sonarsource.python python-checks-testkit diff --git a/python-plugin/pom.xml b/python-plugin/pom.xml index bfef526ff..cbc4d6906 100644 --- a/python-plugin/pom.xml +++ b/python-plugin/pom.xml @@ -44,12 +44,6 @@ test - - junit - junit - test - - From 82de7d781c84ed632e56a2a8468deab526d27512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Boss=C3=A9?= Date: Thu, 6 Apr 2023 15:22:11 +0200 Subject: [PATCH 2/4] :white_check_mark: Fix javascript tests --- javascript-plugin/pom.xml | 12 ++++++++++++ .../javascript/JavaScriptPluginTest.java | 2 +- .../javascript/JavaScriptRulesDefinitionTest.java | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/javascript-plugin/pom.xml b/javascript-plugin/pom.xml index fbe0800be..379b9f388 100644 --- a/javascript-plugin/pom.xml +++ b/javascript-plugin/pom.xml @@ -38,6 +38,18 @@ sonar-analyzer-commons + + org.junit.jupiter + junit-jupiter + test + + + + org.assertj + assertj-core + test + + diff --git a/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptPluginTest.java b/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptPluginTest.java index a558e0626..bf4e49796 100644 --- a/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptPluginTest.java +++ b/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptPluginTest.java @@ -1,6 +1,6 @@ package fr.greencodeinitiative.javascript; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.sonar.api.*; import org.sonar.api.utils.Version; diff --git a/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptRulesDefinitionTest.java b/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptRulesDefinitionTest.java index 60bdc8510..bec05b8ab 100644 --- a/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptRulesDefinitionTest.java +++ b/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptRulesDefinitionTest.java @@ -1,6 +1,6 @@ package fr.greencodeinitiative.javascript; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.sonar.api.server.rule.RulesDefinition; import static org.assertj.core.api.Assertions.assertThat; From 238e0fc8ed6d006833f3b0ac71fd960bae0a856b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Boss=C3=A9?= Date: Tue, 11 Apr 2023 15:17:14 +0200 Subject: [PATCH 3/4] :memo: Add junit removal in CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c42bb9f8..755200a6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed +- [#161](https://github.com/green-code-initiative/ecoCode/pull/161) Remove unnecessary junit dependencies in pom.xml ### Deleted From 05785a5cf5d038a161b959d53d816d665362fa07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Boss=C3=A9?= Date: Fri, 14 Apr 2023 09:05:02 +0200 Subject: [PATCH 4/4] :recycle: Use default package visibility for test classes --- .../greencodeinitiative/javascript/JavaScriptPluginTest.java | 4 ++-- .../javascript/JavaScriptRulesDefinitionTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptPluginTest.java b/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptPluginTest.java index bf4e49796..ad50f25ec 100644 --- a/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptPluginTest.java +++ b/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptPluginTest.java @@ -6,10 +6,10 @@ import static org.assertj.core.api.Assertions.assertThat; -public class JavaScriptPluginTest { +class JavaScriptPluginTest { @Test - public void extensions() { + void extensions() { Plugin.Context context = new Plugin.Context(new MockedSonarRuntime()); new JavaScriptPlugin().define(context); assertThat(context.getExtensions()).hasSize(1); diff --git a/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptRulesDefinitionTest.java b/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptRulesDefinitionTest.java index bec05b8ab..e90f75d95 100644 --- a/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptRulesDefinitionTest.java +++ b/javascript-plugin/src/test/java/fr/greencodeinitiative/javascript/JavaScriptRulesDefinitionTest.java @@ -5,10 +5,10 @@ import static org.assertj.core.api.Assertions.assertThat; -public class JavaScriptRulesDefinitionTest { +class JavaScriptRulesDefinitionTest { @Test - public void createExternalRepository() { + void createExternalRepository() { RulesDefinition.Context context = new RulesDefinition.Context(); new JavaScriptRulesDefinition().define(context); assertThat(context.repositories()).hasSize(1);