diff options
Diffstat (limited to 'sonar-scanner-engine')
8 files changed, 25 insertions, 25 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/JavaCpdBlockIndexerSensorTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/JavaCpdBlockIndexerSensorTest.java index d23e829b11b..2464b134585 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/JavaCpdBlockIndexerSensorTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/JavaCpdBlockIndexerSensorTest.java @@ -40,7 +40,7 @@ import org.sonar.scanner.cpd.index.SonarCpdBlockIndex; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; public class JavaCpdBlockIndexerSensorTest { @@ -73,7 +73,7 @@ public class JavaCpdBlockIndexerSensorTest { public void testExclusions() { file.setExcludedForDuplication(true); new JavaCpdBlockIndexerSensor(index).execute(context); - verifyZeroInteractions(index); + verifyNoInteractions(index); } @Test diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java index 1cf46979e80..5e63367f913 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java @@ -29,7 +29,7 @@ import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.sonar.api.batch.bootstrap.ProjectDefinition; import org.sonar.api.batch.fs.InputComponent; import org.sonar.api.batch.rule.internal.NewActiveRule; @@ -53,7 +53,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.RETURNS_DEEP_STUBS; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) @@ -97,7 +97,7 @@ public class IssuePublisherTest { boolean added = moduleIssues.initAndAddIssue(issue); assertThat(added).isFalse(); - verifyZeroInteractions(reportPublisher); + verifyNoInteractions(reportPublisher); } @Test @@ -112,7 +112,7 @@ public class IssuePublisherTest { boolean added = moduleIssues.initAndAddIssue(issue); assertThat(added).isFalse(); - verifyZeroInteractions(reportPublisher); + verifyNoInteractions(reportPublisher); } @Test @@ -200,7 +200,7 @@ public class IssuePublisherTest { boolean added = moduleIssues.initAndAddIssue(issue); assertThat(added).isFalse(); - verifyZeroInteractions(reportPublisher); + verifyNoInteractions(reportPublisher); } @Test @@ -222,7 +222,7 @@ public class IssuePublisherTest { boolean added = moduleIssues.initAndAddIssue(issue); assertThat(added).isFalse(); - verifyZeroInteractions(reportPublisher); + verifyNoInteractions(reportPublisher); } @Test diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/phases/ModuleSensorsExecutorTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/phases/ModuleSensorsExecutorTest.java index c6c7ab05fd5..2b3658f3157 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/phases/ModuleSensorsExecutorTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/phases/ModuleSensorsExecutorTest.java @@ -53,8 +53,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; @RunWith(DataProviderRunner.class) @@ -113,7 +113,7 @@ public class ModuleSensorsExecutorTest { verify(perModuleSensor).analyse(); verify(perModuleSensor).wrappedSensor(); - verifyZeroInteractions(globalSensor); + verifyNoInteractions(globalSensor); verifyNoMoreInteractions(perModuleSensor, globalSensor); } diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/AnalysisContextReportPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/AnalysisContextReportPublisherTest.java index 1b0841f68d8..54561735cee 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/AnalysisContextReportPublisherTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/AnalysisContextReportPublisherTest.java @@ -48,7 +48,7 @@ import org.sonar.updatecenter.common.Version; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; public class AnalysisContextReportPublisherTest { @@ -99,7 +99,7 @@ public class AnalysisContextReportPublisherTest { assertThat(writer.getFileStructure().analysisLog()).exists(); assertThat(FileUtils.readFileToString(writer.getFileStructure().analysisLog(), StandardCharsets.UTF_8)).contains("Xoo 1.0 (xoo)"); - verifyZeroInteractions(system2); + verifyNoInteractions(system2); } @Test diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ChangedLinesPublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ChangedLinesPublisherTest.java index e8383c54f73..0c6e5d2c2cc 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ChangedLinesPublisherTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ChangedLinesPublisherTest.java @@ -47,7 +47,7 @@ import org.sonar.scanner.scm.ScmConfiguration; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assumptions.assumeThat; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; public class ChangedLinesPublisherTest { @@ -85,7 +85,7 @@ public class ChangedLinesPublisherTest { public void skip_if_scm_is_disabled() { when(scmConfiguration.isDisabled()).thenReturn(true); publisher.publish(writer); - verifyZeroInteractions(inputComponentStore, inputModuleHierarchy, provider); + verifyNoInteractions(inputComponentStore, inputModuleHierarchy, provider); assertNotPublished(); } @@ -93,7 +93,7 @@ public class ChangedLinesPublisherTest { public void skip_if_not_pr() { when(branchConfiguration.isPullRequest()).thenReturn(false); publisher.publish(writer); - verifyZeroInteractions(inputComponentStore, inputModuleHierarchy, provider); + verifyNoInteractions(inputComponentStore, inputModuleHierarchy, provider); assertNotPublished(); } @@ -101,7 +101,7 @@ public class ChangedLinesPublisherTest { public void skip_if_target_branch_is_null() { when(branchConfiguration.targetBranchName()).thenReturn(null); publisher.publish(writer); - verifyZeroInteractions(inputComponentStore, inputModuleHierarchy, provider); + verifyNoInteractions(inputComponentStore, inputModuleHierarchy, provider); assertNotPublished(); } @@ -109,7 +109,7 @@ public class ChangedLinesPublisherTest { public void skip_if_no_scm_provider() { when(scmConfiguration.provider()).thenReturn(null); publisher.publish(writer); - verifyZeroInteractions(inputComponentStore, inputModuleHierarchy, provider); + verifyNoInteractions(inputComponentStore, inputModuleHierarchy, provider); assertNotPublished(); } diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmChangedFilesProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmChangedFilesProviderTest.java index d8c1576c289..ec319e1c931 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmChangedFilesProviderTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmChangedFilesProviderTest.java @@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; public class ScmChangedFilesProviderTest { @@ -100,7 +100,7 @@ public class ScmChangedFilesProviderTest { ScmChangedFiles scmChangedFiles = provider.provide(scmConfiguration, branchConfiguration, project); assertThat(scmChangedFiles.get()).isNull(); - verifyZeroInteractions(scmConfiguration); + verifyNoInteractions(scmConfiguration); } @Test diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorStorageTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorStorageTest.java index 6cbde59679d..bb5d8f78bea 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorStorageTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorStorageTest.java @@ -65,8 +65,8 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.data.MapEntry.entry; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; public class DefaultSensorStorageTest { @@ -201,7 +201,7 @@ public class DefaultSensorStorageTest { DefaultIssue issue = new DefaultIssue(project).at(new DefaultIssueLocation().on(file)); underTest.store(issue); - verifyZeroInteractions(moduleIssues); + verifyNoInteractions(moduleIssues); } @Test diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/JGitBlameCommandTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/JGitBlameCommandTest.java index be64c480015..6ceb80baf7f 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/JGitBlameCommandTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/JGitBlameCommandTest.java @@ -52,10 +52,10 @@ import org.sonar.api.utils.log.LogTester; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assume.assumeTrue; -import static org.mockito.Matchers.startsWith; +import static org.mockito.ArgumentMatchers.startsWith; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import static org.sonar.scm.git.Utils.javaUnzip; @@ -291,7 +291,7 @@ public class JGitBlameCommandTest { assertThat(logTester.logs()).first() .matches(s -> s.contains("Shallow clone detected, no blame information will be provided.")); - verifyZeroInteractions(output); + verifyNoInteractions(output); verify(analysisWarnings).addUnique(startsWith("Shallow clone detected")); } @@ -322,7 +322,7 @@ public class JGitBlameCommandTest { assertThat(output.blame).containsKey(inputFile); assertThat(output.blame.get(inputFile).stream().map(BlameLine::revision)) .containsOnly("6b3aab35a3ea32c1636fee56f996e677653c48ea", "843c7c30d7ebd9a479e8f1daead91036c75cbc4e", "0d269c1acfb8e6d4d33f3c43041eb87e0df0f5e7"); - verifyZeroInteractions(analysisWarnings); + verifyNoInteractions(analysisWarnings); } private File createNewTempFolder() throws IOException { |