diff --git a/pom.xml b/pom.xml index c2cbdc4..b5a2fdb 100644 --- a/pom.xml +++ b/pom.xml @@ -272,13 +272,7 @@ **/*Test.java - - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - - + diff --git a/src/test/java/com/societegenerale/commons/plugin/service/AbstractExcludePathTest.java b/src/test/java/com/societegenerale/commons/plugin/service/AbstractExcludePathTest.java index 906f986..f1ddd7a 100644 --- a/src/test/java/com/societegenerale/commons/plugin/service/AbstractExcludePathTest.java +++ b/src/test/java/com/societegenerale/commons/plugin/service/AbstractExcludePathTest.java @@ -7,7 +7,8 @@ import com.societegenerale.commons.plugin.Log; import org.apache.commons.io.FileUtils; -import org.mockito.Mock; + +import static org.mockito.Mockito.mock; abstract class AbstractExcludePathTest { @@ -58,8 +59,7 @@ abstract class AbstractExcludePathTest private static Path tempJavaFileWithFileComment = null; private static Path tempJavaFileWithDefaultPackage = null; - @Mock - private Log logger; + private final Log logger=mock(Log.class); static void init() throws IOException { diff --git a/src/test/java/com/societegenerale/commons/plugin/service/ExcludedPathsPreProcessorTest.java b/src/test/java/com/societegenerale/commons/plugin/service/ExcludedPathsPreProcessorTest.java index 3fb9aed..a32bfa5 100644 --- a/src/test/java/com/societegenerale/commons/plugin/service/ExcludedPathsPreProcessorTest.java +++ b/src/test/java/com/societegenerale/commons/plugin/service/ExcludedPathsPreProcessorTest.java @@ -8,28 +8,24 @@ import java.util.HashSet; import java.util.Set; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; import static com.societegenerale.commons.plugin.service.ExcludedPathsPreProcessor.PACKAGE_INFO_JAVA; import static org.assertj.core.api.Assertions.assertThat; - -@RunWith (MockitoJUnitRunner.class) public class ExcludedPathsPreProcessorTest extends AbstractExcludePathTest { private final ExcludedPathsPreProcessor preProcessor = new ExcludedPathsPreProcessor(); - @BeforeClass + @BeforeAll public static void init() throws IOException { AbstractExcludePathTest.init(); } - @AfterClass + @AfterAll public static void cleanup() throws IOException { AbstractExcludePathTest.cleanup(); diff --git a/src/test/java/com/societegenerale/commons/plugin/service/JavaFileParserTest.java b/src/test/java/com/societegenerale/commons/plugin/service/JavaFileParserTest.java index dde16c3..25d67e2 100644 --- a/src/test/java/com/societegenerale/commons/plugin/service/JavaFileParserTest.java +++ b/src/test/java/com/societegenerale/commons/plugin/service/JavaFileParserTest.java @@ -2,8 +2,8 @@ import java.io.IOException; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -12,13 +12,13 @@ public class JavaFileParserTest extends AbstractExcludePathTest { private final JavaFileParser javaFileParser = new JavaFileParser(); - @BeforeClass + @BeforeAll public static void init() throws IOException { AbstractExcludePathTest.init(); } - @AfterClass + @AfterAll public static void cleanup() throws IOException { AbstractExcludePathTest.cleanup(); diff --git a/src/test/java/com/societegenerale/commons/plugin/utils/ExclusionImportOptionTest.java b/src/test/java/com/societegenerale/commons/plugin/utils/ExclusionImportOptionTest.java index 8dd16b1..a016183 100644 --- a/src/test/java/com/societegenerale/commons/plugin/utils/ExclusionImportOptionTest.java +++ b/src/test/java/com/societegenerale/commons/plugin/utils/ExclusionImportOptionTest.java @@ -8,12 +8,12 @@ import com.societegenerale.commons.plugin.Log; import com.societegenerale.commons.plugin.SilentLogWithMemory; import com.tngtech.archunit.core.importer.Location; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ExclusionImportOptionTest { @@ -24,14 +24,14 @@ public class ExclusionImportOptionTest { private final Log log = new SilentLogWithMemory(); - @BeforeClass + @BeforeAll public static void init() throws IOException { testRootDir = Files.createTempDirectory("ExclusionImportOptionTest"); locationToBeExcluded = Location.of(Paths.get(testRootDir.toString(), "com", "societegenerale", "commons", "plugin", "utils", "Foo.class")); locationToBeIncluded = Location.of(Paths.get(testRootDir.toString(), "com", "societegenerale", "commons", "plugin", "Bar.class")); } - @AfterClass + @AfterAll public static void cleanUp() throws IOException { if (testRootDir != null) { Files.deleteIfExists(testRootDir);