From 1ef4b61319436eae7f247c5c8801ebdafeb58bb6 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 10 Aug 2019 09:19:15 +0300 Subject: [PATCH] Removed vintage engine (JUnit 4) dependency --- Plan/build.gradle | 1 - .../src/test/java/rules/ComponentMocker.java | 27 ---------- .../java/rules/PluginComponentMocker.java | 54 ------------------- .../test/java/utilities/HTTPConnector.java | 4 +- 4 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 Plan/common/src/test/java/rules/ComponentMocker.java delete mode 100644 Plan/common/src/test/java/rules/PluginComponentMocker.java diff --git a/Plan/build.gradle b/Plan/build.gradle index 14f3bb8b0..1f2aca3c9 100644 --- a/Plan/build.gradle +++ b/Plan/build.gradle @@ -116,7 +116,6 @@ subprojects { // Test Tooling Dependencies testCompile "org.junit.jupiter:junit-jupiter-engine:5.5.1" // JUnit 5 testCompile "org.junit.platform:junit-platform-runner:1.5.1" // JUnit 4 runner for JUnit 5 tests - testCompile "org.junit.vintage:junit-vintage-engine:5.5.1" // JUnit 4 compatibility for JUnit 5 testCompile "org.junit.jupiter:junit-jupiter-params:5.5.1" // JUnit 5, parameterized tests testCompile "org.mockito:mockito-core:3.0.0" // Mockito Core testCompile "org.mockito:mockito-junit-jupiter:3.0.0" // Mockito JUnit 5 Extension diff --git a/Plan/common/src/test/java/rules/ComponentMocker.java b/Plan/common/src/test/java/rules/ComponentMocker.java deleted file mode 100644 index 359adca5b..000000000 --- a/Plan/common/src/test/java/rules/ComponentMocker.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This file is part of Player Analytics (Plan). - * - * Plan is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License v3 as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Plan is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Plan. If not, see . - */ -package rules; - -import com.djrapitops.plan.PlanPlugin; -import com.djrapitops.plan.system.PlanSystem; -import org.junit.rules.TestRule; - -public interface ComponentMocker extends TestRule { - PlanPlugin getPlanMock(); - - PlanSystem getPlanSystem(); -} diff --git a/Plan/common/src/test/java/rules/PluginComponentMocker.java b/Plan/common/src/test/java/rules/PluginComponentMocker.java deleted file mode 100644 index 8530e6b7a..000000000 --- a/Plan/common/src/test/java/rules/PluginComponentMocker.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This file is part of Player Analytics (Plan). - * - * Plan is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License v3 as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Plan is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Plan. If not, see . - */ -package rules; - -import com.djrapitops.plan.PlanPlugin; -import com.djrapitops.plan.system.PlanSystem; -import org.junit.rules.ExternalResource; -import org.junit.rules.TemporaryFolder; -import utilities.dagger.DaggerPlanPluginComponent; -import utilities.dagger.PlanPluginComponent; -import utilities.mocks.PlanPluginMocker; - -public class PluginComponentMocker extends ExternalResource implements ComponentMocker { - private final TemporaryFolder testFolder; - - private PlanPlugin planMock; - private PlanPluginComponent component; - - public PluginComponentMocker(TemporaryFolder testFolder) { - this.testFolder = testFolder; - } - - @Override - protected void before() throws Throwable { - PlanPluginMocker mocker = PlanPluginMocker.setUp() - .withDataFolder(testFolder.newFolder()) - .withResourceFetchingFromJar() - .withLogging(); - planMock = mocker.getPlanMock(); - component = DaggerPlanPluginComponent.builder().plan(planMock).build(); - } - - public PlanPlugin getPlanMock() { - return planMock; - } - - public PlanSystem getPlanSystem() { - return component.system(); - } -} diff --git a/Plan/common/src/test/java/utilities/HTTPConnector.java b/Plan/common/src/test/java/utilities/HTTPConnector.java index 8b60b67b3..8685fedbe 100644 --- a/Plan/common/src/test/java/utilities/HTTPConnector.java +++ b/Plan/common/src/test/java/utilities/HTTPConnector.java @@ -16,8 +16,6 @@ */ package utilities; -import org.junit.rules.ExternalResource; - import javax.net.ssl.*; import java.io.IOException; import java.net.HttpURLConnection; @@ -25,7 +23,7 @@ import java.net.URL; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; -public class HTTPConnector extends ExternalResource { +public class HTTPConnector { private static final TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() {