From eb715d0e05a36109c550a042771f38116608e513 Mon Sep 17 00:00:00 2001 From: "Sean C. Sullivan" Date: Sat, 2 Jan 2021 18:48:02 -0800 Subject: [PATCH] upgrade to Mockito 3 --- pitest-ant/src/test/java/org/pitest/ant/PitestTaskTest.java | 6 +++--- .../src/test/java/com/example/MockitoRunnerTest.java | 2 +- .../mutationtest/build/CompoundMutationInterceptorTest.java | 2 +- .../org/pitest/mutationtest/build/MutationSourceTest.java | 2 +- .../test/java/org/pitest/maven/NonEmptyProjectCheckIT.java | 2 +- .../java/org/pitest/maven/report/PitReportMojoTest.java | 2 +- .../maven/report/generator/ReportGenerationManagerTest.java | 2 +- .../java/org/pitest/coverage/codeassist/LineMapperTest.java | 2 +- .../java/org/pitest/util/CachingByteArraySourceTest.java | 2 +- pom.xml | 4 ++-- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pitest-ant/src/test/java/org/pitest/ant/PitestTaskTest.java b/pitest-ant/src/test/java/org/pitest/ant/PitestTaskTest.java index c70a51fcf..1bd2000f4 100644 --- a/pitest-ant/src/test/java/org/pitest/ant/PitestTaskTest.java +++ b/pitest-ant/src/test/java/org/pitest/ant/PitestTaskTest.java @@ -36,7 +36,7 @@ import org.junit.runner.RunWith; import org.mockito.ArgumentMatcher; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.pitest.mutationtest.commandline.MutationCoverageReport; @RunWith(MockitoJUnitRunner.class) @@ -489,7 +489,7 @@ public void shouldPassMutationMatrixFlagToJavaTask() { verify(this.arg).setValue("--fullMutationMatrix=true"); } - private static class PathMatcher extends ArgumentMatcher { + private static class PathMatcher implements ArgumentMatcher { private final String[] expectedPaths; @@ -498,7 +498,7 @@ public PathMatcher(final String path) { } @Override - public boolean matches(final Object argument) { + public boolean matches(final Path argument) { final Path argPath = (Path) argument; final String[] paths = argPath.toString().split(File.pathSeparator); final boolean matches = paths.length == this.expectedPaths.length; diff --git a/pitest-entry/src/test/java/com/example/MockitoRunnerTest.java b/pitest-entry/src/test/java/com/example/MockitoRunnerTest.java index 32eb038b5..67fff6cb6 100644 --- a/pitest-entry/src/test/java/com/example/MockitoRunnerTest.java +++ b/pitest-entry/src/test/java/com/example/MockitoRunnerTest.java @@ -19,7 +19,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class MockitoRunnerTest { diff --git a/pitest-entry/src/test/java/org/pitest/mutationtest/build/CompoundMutationInterceptorTest.java b/pitest-entry/src/test/java/org/pitest/mutationtest/build/CompoundMutationInterceptorTest.java index 29b00db3e..da63fe438 100644 --- a/pitest-entry/src/test/java/org/pitest/mutationtest/build/CompoundMutationInterceptorTest.java +++ b/pitest-entry/src/test/java/org/pitest/mutationtest/build/CompoundMutationInterceptorTest.java @@ -13,7 +13,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.pitest.bytecode.analysis.ClassTree; import org.pitest.mutationtest.engine.Mutater; import org.pitest.mutationtest.engine.MutationDetails; diff --git a/pitest-entry/src/test/java/org/pitest/mutationtest/build/MutationSourceTest.java b/pitest-entry/src/test/java/org/pitest/mutationtest/build/MutationSourceTest.java index ae4bbe54d..f00648979 100644 --- a/pitest-entry/src/test/java/org/pitest/mutationtest/build/MutationSourceTest.java +++ b/pitest-entry/src/test/java/org/pitest/mutationtest/build/MutationSourceTest.java @@ -4,7 +4,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.pitest.classinfo.ClassByteArraySource; import org.pitest.classinfo.ClassName; import org.pitest.classpath.ClassloaderByteArraySource; diff --git a/pitest-maven/src/test/java/org/pitest/maven/NonEmptyProjectCheckIT.java b/pitest-maven/src/test/java/org/pitest/maven/NonEmptyProjectCheckIT.java index 6ad83f0a6..64d464a39 100644 --- a/pitest-maven/src/test/java/org/pitest/maven/NonEmptyProjectCheckIT.java +++ b/pitest-maven/src/test/java/org/pitest/maven/NonEmptyProjectCheckIT.java @@ -13,7 +13,7 @@ import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; @Category(SystemTest.class) @RunWith(MockitoJUnitRunner.class) diff --git a/pitest-maven/src/test/java/org/pitest/maven/report/PitReportMojoTest.java b/pitest-maven/src/test/java/org/pitest/maven/report/PitReportMojoTest.java index 5c6f44e62..b835f5567 100644 --- a/pitest-maven/src/test/java/org/pitest/maven/report/PitReportMojoTest.java +++ b/pitest-maven/src/test/java/org/pitest/maven/report/PitReportMojoTest.java @@ -32,7 +32,7 @@ import org.mockito.Captor; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.pitest.maven.report.generator.ReportGenerationContext; import org.pitest.maven.report.generator.ReportGenerationManager; import org.pitest.util.PitError; diff --git a/pitest-maven/src/test/java/org/pitest/maven/report/generator/ReportGenerationManagerTest.java b/pitest-maven/src/test/java/org/pitest/maven/report/generator/ReportGenerationManagerTest.java index a580ffb5e..9cad90989 100644 --- a/pitest-maven/src/test/java/org/pitest/maven/report/generator/ReportGenerationManagerTest.java +++ b/pitest-maven/src/test/java/org/pitest/maven/report/generator/ReportGenerationManagerTest.java @@ -31,7 +31,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.pitest.maven.report.ReportSourceLocator; import org.pitest.util.PitError; diff --git a/pitest/src/test/java/org/pitest/coverage/codeassist/LineMapperTest.java b/pitest/src/test/java/org/pitest/coverage/codeassist/LineMapperTest.java index 2aa17d2c3..6eddae6db 100644 --- a/pitest/src/test/java/org/pitest/coverage/codeassist/LineMapperTest.java +++ b/pitest/src/test/java/org/pitest/coverage/codeassist/LineMapperTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.pitest.classinfo.ClassName; import org.pitest.classpath.CodeSource; import org.pitest.coverage.BlockLocation; diff --git a/pitest/src/test/java/org/pitest/util/CachingByteArraySourceTest.java b/pitest/src/test/java/org/pitest/util/CachingByteArraySourceTest.java index 273cd6ea6..ce9f05e9f 100644 --- a/pitest/src/test/java/org/pitest/util/CachingByteArraySourceTest.java +++ b/pitest/src/test/java/org/pitest/util/CachingByteArraySourceTest.java @@ -8,7 +8,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.pitest.classinfo.CachingByteArraySource; import org.pitest.classinfo.ClassByteArraySource; import java.util.Optional; diff --git a/pom.xml b/pom.xml index c696a257f..79f5f2044 100644 --- a/pom.xml +++ b/pom.xml @@ -147,8 +147,8 @@ org.mockito - mockito-all - 1.9.5 + mockito-core + 3.6.28 test