]> source.dussan.org Git - sonarqube.git/commitdiff
NO-JIRA Update Mockito and simpleframework to latest major version
authorLéo Geoffroy <99647462+leo-geoffroy-sonarsource@users.noreply.github.com>
Mon, 4 Apr 2022 16:08:34 +0000 (18:08 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 4 Apr 2022 20:02:56 +0000 (20:02 +0000)
85 files changed:
build.gradle
server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapAutodiscoveryTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/CloseIssuesOnRemovedComponentsVisitorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/ClosedIssuesInputFactoryTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/ComponentIssuesLoaderTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/IssueCreationDateCalculatorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/LoadComponentUuidsHavingOpenIssuesVisitorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/MovedIssueVisitorTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/commonrule/CommonRuleEngineImplTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/measure/MeasureRepositoryImplTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/notification/ReportAnalysisFailureNotificationHandlerTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/scm/ScmInfoRepositoryImplTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/source/FileSourceDataWarningsTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/source/LineReadersImplTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/source/SourceLinesHashRepositoryImplTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/LoadCrossProjectDuplicationsRepositoryStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/PersistProjectLinksStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/QualityGateEventsStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/SendIssueNotificationsStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/TriggerViewRefreshStepTest.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectexport/file/ExportLineHashesStepTest.java
server/sonar-ce-task/src/test/java/org/sonar/ce/task/log/CeTaskMessagesImplTest.java
server/sonar-ce/src/test/java/org/sonar/ce/monitoring/DistributedCEQueueStatusImplTest.java
server/sonar-ce/src/test/java/org/sonar/ce/notification/ReportAnalysisFailureNotificationExecutionListenerTest.java
server/sonar-ce/src/test/java/org/sonar/ce/platform/DatabaseCompatibilityTest.java
server/sonar-ce/src/test/java/org/sonar/ce/queue/CeQueueInitializerTest.java
server/sonar-ce/src/test/java/org/sonar/ce/queue/InternalCeQueueImplTest.java
server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/CeWorkerImplTest.java
server/sonar-ce/src/test/java/org/sonar/ce/taskprocessor/SimpleCeTaskInterrupterTest.java
server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/charset/OracleCharsetHandlerTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/charset/PostgresCharsetHandlerTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/engine/MigrationEngineImplTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/history/NoTableMigrationHistoryImplTest.java
server/sonar-main/src/test/java/org/sonar/application/AppReloaderImplTest.java
server/sonar-process/src/test/java/org/sonar/process/cluster/health/HealthStateRefresherTest.java
server/sonar-server-common/src/test/java/org/sonar/server/es/searchrequest/TopAggregationHelperTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/ChangesOnMyIssueNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/FPOrWontFixNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationHandlerTest.java
server/sonar-server-common/src/test/java/org/sonar/server/notification/NotificationServiceTest.java
server/sonar-server-common/src/test/java/org/sonar/server/qualitygate/notification/QGChangeNotificationHandlerTest.java
server/sonar-webserver-api/src/test/java/org/sonar/server/qualitygate/changeevent/QGChangeEventListenersImplTest.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/BasicAuthenticationTest.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsExternalAuthenticationTest.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/InitFilterTest.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/OAuth2CallbackFilterTest.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/event/AuthenticationEventImplTest.java
server/sonar-webserver-core/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java
server/sonar-webserver-core/src/test/java/org/sonar/server/platform/db/migration/AutoDbMigrationTest.java
server/sonar-webserver-core/src/test/java/org/sonar/server/webhook/WebhookQGChangeEventListenerTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/authentication/ws/LoginActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/branch/pr/ws/DeleteActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/ce/ws/CancelAllActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/CommentActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/IssueUpdaterTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/platform/ws/IndexActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/plugins/ws/InstalledActionTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/QProfileCopierTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/QProfileFactoryImplTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/RegisterQualityProfilesNotificationTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/builtin/BuiltInQPChangeNotificationHandlerTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/qualityprofile/builtin/BuiltInQualityProfilesUpdateListenerTest.java
server/sonar-webserver/src/test/java/org/sonar/server/app/NullJarScannerTest.java
server/sonar-webserver/src/test/java/org/sonar/server/app/TomcatAccessLogTest.java
server/sonar-webserver/src/test/java/org/sonar/server/platform/web/CacheControlFilterTest.java
server/sonar-webserver/src/test/java/org/sonar/server/platform/web/RedirectFilterTest.java
server/sonar-webserver/src/test/java/org/sonar/server/platform/web/WebPagesFilterTest.java
sonar-core/src/test/java/org/sonar/core/i18n/DurationLabelTest.java
sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java
sonar-core/src/test/java/org/sonar/core/util/DefaultHttpDownloaderTest.java
sonar-duplications/src/test/java/org/sonar/duplications/token/BlackHoleTokenChannelTest.java
sonar-duplications/src/test/java/org/sonar/duplications/token/TokenChannelTest.java
sonar-plugin-api-impl/src/test/java/org/sonar/api/batch/sensor/cpd/internal/DefaultCpdTokensTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/log/ConsoleLoggerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/JavaCpdBlockIndexerSensorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/phases/ModuleSensorsExecutorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/report/AnalysisContextReportPublisherTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ChangedLinesPublisherTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scm/ScmChangedFilesProviderTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorStorageTest.java
sonar-scanner-engine/src/test/java/org/sonar/scm/git/JGitBlameCommandTest.java

index 5ed5d540aba8f2cf98f1c4823624edf8f686701d..72ada93f85d67beab02da61e4adb3c92d0e89719 100644 (file)
@@ -300,7 +300,7 @@ subprojects {
       dependency 'org.hamcrest:hamcrest-all:1.3'
       dependency 'org.jsoup:jsoup:1.14.3'
       dependency 'org.mindrot:jbcrypt:0.4'
-      dependency('org.mockito:mockito-core:3.12.4') {
+      dependency('org.mockito:mockito-core:4.4.0') {
         exclude 'org.hamcrest:hamcrest-core'
       }
       dependency 'org.mybatis:mybatis:3.5.9'
@@ -313,7 +313,7 @@ subprojects {
       }
       dependency 'org.postgresql:postgresql:42.3.3'
       dependency 'org.reflections:reflections:0.10.2'
-      dependency 'org.simpleframework:simple:4.1.21'
+      dependency 'org.simpleframework:simple:5.1.6'
       dependency 'org.sonarsource.orchestrator:sonar-orchestrator:3.37.0.87'
       dependency 'org.sonarsource.update-center:sonar-update-center-common:1.23.0.723'
       dependency('org.springframework:spring-context:5.3.18') {
index 50e841771dd7fc58673bbba4c96455e7979fd42b..276075a8b6042d1514e207c46d5dc6d5e8168946 100644 (file)
@@ -73,7 +73,7 @@ public class LdapAutodiscoveryTest {
     Attribute attribute = mock(Attribute.class);
     NamingEnumeration namingEnumeration = mock(NamingEnumeration.class);
 
-    when(context.getAttributes(Mockito.anyString(), Mockito.anyObject())).thenReturn(attributes);
+    when(context.getAttributes(Mockito.anyString(), Mockito.any())).thenReturn(attributes);
     when(attributes.get("srv")).thenReturn(attribute);
     when(attribute.getAll()).thenReturn(namingEnumeration);
     when(namingEnumeration.hasMore()).thenReturn(true, true, true, true, true, false);
index f5880143bd03dc3cc8b38c3f0602c2a3ed4b2003..8017b4f99db2ef473ed0102906bd3aed3fca14aa 100644 (file)
@@ -38,7 +38,7 @@ import static com.google.common.collect.Sets.newHashSet;
 import static org.assertj.core.api.Assertions.assertThat;
 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.ce.task.projectanalysis.component.Component.Type.DIRECTORY;
 import static org.sonar.ce.task.projectanalysis.component.Component.Type.FILE;
@@ -90,7 +90,7 @@ public class CloseIssuesOnRemovedComponentsVisitorTest {
 
     underTest.visit(ReportComponent.builder(PROJECT, 1).build());
 
-    verifyZeroInteractions(issueLifecycle);
+    verifyNoInteractions(issueLifecycle);
     CloseableIterator<DefaultIssue> issues = protoIssueCache.traverse();
     assertThat(issues.hasNext()).isFalse();
   }
@@ -99,7 +99,7 @@ public class CloseIssuesOnRemovedComponentsVisitorTest {
   public void do_nothing_on_directory() {
     underTest.visit(ReportComponent.builder(DIRECTORY, 1).build());
 
-    verifyZeroInteractions(issueLifecycle);
+    verifyNoInteractions(issueLifecycle);
     CloseableIterator<DefaultIssue> issues = protoIssueCache.traverse();
     assertThat(issues.hasNext()).isFalse();
   }
@@ -108,7 +108,7 @@ public class CloseIssuesOnRemovedComponentsVisitorTest {
   public void do_nothing_on_file() {
     underTest.visit(ReportComponent.builder(FILE, 1).build());
 
-    verifyZeroInteractions(issueLifecycle);
+    verifyNoInteractions(issueLifecycle);
     CloseableIterator<DefaultIssue> issues = protoIssueCache.traverse();
     assertThat(issues.hasNext()).isFalse();
   }
index efac6c783a325ff1cb29355c1bec948c2a5bac05..62ce9c2743931515b10457df9ed725a455fe38da 100644 (file)
@@ -34,7 +34,7 @@ import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.when;
 
 public class ClosedIssuesInputFactoryTest {
@@ -51,7 +51,7 @@ public class ClosedIssuesInputFactoryTest {
 
     Input<DefaultIssue> input = underTest.create(component);
 
-    verifyZeroInteractions(dbClient, issuesLoader);
+    verifyNoInteractions(dbClient, issuesLoader);
 
     List<DefaultIssue> issues = ImmutableList.of(new DefaultIssue(), new DefaultIssue());
     when(issuesLoader.loadClosedIssues(componentUuid)).thenReturn(issues);
@@ -69,7 +69,7 @@ public class ClosedIssuesInputFactoryTest {
 
     Input<DefaultIssue> input = underTest.create(component);
 
-    verifyZeroInteractions(dbClient, issuesLoader);
+    verifyNoInteractions(dbClient, issuesLoader);
 
     List<DefaultIssue> issues = ImmutableList.of();
     when(issuesLoader.loadClosedIssues(originalComponentUuid)).thenReturn(issues);
@@ -85,7 +85,7 @@ public class ClosedIssuesInputFactoryTest {
 
     Input<DefaultIssue> input = underTest.create(component);
 
-    verifyZeroInteractions(dbClient, issuesLoader);
+    verifyNoInteractions(dbClient, issuesLoader);
 
     List<DefaultIssue> issues = ImmutableList.of(new DefaultIssue());
     when(issuesLoader.loadClosedIssues(componentUuid)).thenReturn(issues);
@@ -95,6 +95,6 @@ public class ClosedIssuesInputFactoryTest {
     reset(issuesLoader);
 
     assertThat(input.getIssues()).isSameAs(issues);
-    verifyZeroInteractions(issuesLoader);
+    verifyNoInteractions(issuesLoader);
   }
 }
index bcbf18849c4f376399a3300658c71ff847dcb39c..193433a31e3011dc7805452d0d78c2fc07d7f21a 100644 (file)
@@ -51,7 +51,7 @@ import static java.util.Collections.emptyList;
 import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 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;
 import static org.sonar.api.issue.Issue.STATUS_CLOSED;
 import static org.sonar.api.rules.RuleType.CODE_SMELL;
@@ -215,7 +215,7 @@ public class ComponentIssuesLoaderTest {
 
     assertThat(underTest.loadClosedIssues(componentUuid)).isEmpty();
 
-    verifyZeroInteractions(dbClient, system2);
+    verifyNoInteractions(dbClient, system2);
   }
 
   @Test
@@ -226,7 +226,7 @@ public class ComponentIssuesLoaderTest {
 
     underTest.loadLatestDiffChangesForReopeningOfClosedIssues(emptyList());
 
-    verifyZeroInteractions(dbClient, system2);
+    verifyNoInteractions(dbClient, system2);
   }
 
   @Test
index 3c08e193e57c0914663b49df29ee1d91a75b4d5f..6d95de1cc670240486c9d25dac1a2e3452e5be61 100644 (file)
@@ -61,7 +61,7 @@ import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 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.ce.task.projectanalysis.qualityprofile.QProfileStatusRepository.Status.UNCHANGED;
 
@@ -317,7 +317,7 @@ public class IssueCreationDateCalculatorTest {
     run();
 
     assertChangeOfCreationDateTo(expectedDate);
-    verifyZeroInteractions(activeRulesHolder);
+    verifyNoInteractions(activeRulesHolder);
   }
 
   @DataProvider
index 083d7fc2bc271318fc08d5fcd7cecb512f91f1a2..60c76ae8985e08de9c108138ff0a10b21ad3b401 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.ce.task.projectanalysis.component.VisitorsCrawler;
 import static com.google.common.collect.Sets.newHashSet;
 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.ce.task.projectanalysis.component.Component.Type.DIRECTORY;
 import static org.sonar.ce.task.projectanalysis.component.Component.Type.FILE;
@@ -55,6 +55,6 @@ public class LoadComponentUuidsHavingOpenIssuesVisitorTest {
     underTest.visit(ReportComponent.builder(DIRECTORY, 1).build());
     underTest.visit(ReportComponent.builder(FILE, 1).build());
 
-    verifyZeroInteractions(componentsWithUnprocessedIssues);
+    verifyNoInteractions(componentsWithUnprocessedIssues);
   }
 }
index 88e38898e0267e1c409059309daa5ab2e27175d8..968db8e4443e530dcdad08328184c3b9b85edcf6 100644 (file)
@@ -38,8 +38,8 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 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 MovedIssueVisitorTest {
@@ -69,7 +69,7 @@ public class MovedIssueVisitorTest {
     DefaultIssue issue = mock(DefaultIssue.class);
     underTest.onIssue(ReportComponent.builder(Component.Type.DIRECTORY, 1).build(), issue);
 
-    verifyZeroInteractions(issue);
+    verifyNoInteractions(issue);
   }
 
   @Test
index b2751986ce1d11b3f6dbd78dab6ea04373470ed4..6d69ef99d8975a204e33fc52a90efa2e9f31178c 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.core.issue.DefaultIssue;
 
 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;
 import static org.sonar.ce.task.projectanalysis.component.ReportComponent.DUMB_PROJECT;
 
@@ -62,7 +62,7 @@ public class CommonRuleEngineImplTest {
     Collection<DefaultIssue> issues = underTest.process(file);
 
     assertThat(issues).isEmpty();
-    verifyZeroInteractions(rule1, rule2);
+    verifyNoInteractions(rule1, rule2);
   }
 
   @Test
@@ -70,6 +70,6 @@ public class CommonRuleEngineImplTest {
     Collection<DefaultIssue> issues = underTest.process(DUMB_PROJECT);
 
     assertThat(issues).isEmpty();
-    verifyZeroInteractions(rule1, rule2);
+    verifyNoInteractions(rule1, rule2);
   }
 }
index 41c0d8234459976813ac9087f2e740716f3ec9e3..84a447cb6b7ed2eaf2545ab23941cdceccf9b531 100644 (file)
@@ -57,8 +57,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.fail;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
 
@@ -115,7 +115,7 @@ public class MeasureRepositoryImplTest {
       underTestWithMock.getBaseMeasure(null, metric1);
       fail("an NPE should have been raised");
     } catch (NullPointerException e) {
-      verifyZeroInteractions(mockedDbClient);
+      verifyNoInteractions(mockedDbClient);
     }
   }
 
@@ -125,7 +125,7 @@ public class MeasureRepositoryImplTest {
       underTestWithMock.getBaseMeasure(FILE_COMPONENT, null);
       fail("an NPE should have been raised");
     } catch (NullPointerException e) {
-      verifyZeroInteractions(mockedDbClient);
+      verifyNoInteractions(mockedDbClient);
     }
   }
 
index e0571fe8d0c43f150c0b5079568500fdffcb2e7f..55520fe18ce27794f37941ae1a48d929d4ed9b75 100644 (file)
@@ -42,8 +42,8 @@ import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 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;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBAL_NOTIFICATION;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
@@ -92,7 +92,7 @@ public class ReportAnalysisFailureNotificationHandlerTest {
     int deliver = underTest.deliver(Collections.emptyList());
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager, emailNotificationChannel);
+    verifyNoInteractions(notificationManager, emailNotificationChannel);
   }
 
   @Test
@@ -105,10 +105,10 @@ public class ReportAnalysisFailureNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
   @Test
@@ -121,7 +121,7 @@ public class ReportAnalysisFailureNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
     notifications.forEach(notification -> {
index 9faf3d250465e9b856a638000b0570a95e20cd67..16c69b83a34c844a9676c6fd1acff1e2f369b532 100644 (file)
@@ -52,8 +52,8 @@ 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.verifyNoInteractions;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.api.utils.log.LoggerLevel.TRACE;
 import static org.sonar.ce.task.projectanalysis.component.ReportComponent.builder;
@@ -105,9 +105,9 @@ public class ScmInfoRepositoryImplTest {
     underTest.getScmInfo(FILE);
     assertThat(logTester.logs(TRACE)).isEmpty();
 
-    verifyZeroInteractions(dbLoader);
-    verifyZeroInteractions(sourceHashRepository);
-    verifyZeroInteractions(diff);
+    verifyNoInteractions(dbLoader);
+    verifyNoInteractions(sourceHashRepository);
+    verifyNoInteractions(diff);
   }
 
   @Test
@@ -124,9 +124,9 @@ public class ScmInfoRepositoryImplTest {
 
     assertThat(logTester.logs(TRACE)).containsOnly("Reading SCM info from report for file 'FILE_KEY'");
 
-    verifyZeroInteractions(dbLoader);
-    verifyZeroInteractions(sourceHashRepository);
-    verifyZeroInteractions(diff);
+    verifyNoInteractions(dbLoader);
+    verifyNoInteractions(sourceHashRepository);
+    verifyNoInteractions(diff);
   }
 
   @Test
@@ -144,7 +144,7 @@ public class ScmInfoRepositoryImplTest {
 
     verifyNoMoreInteractions(dbLoader);
     verifyNoMoreInteractions(sourceHashRepository);
-    verifyZeroInteractions(diff);
+    verifyNoInteractions(diff);
   }
 
   @Test
@@ -163,7 +163,7 @@ public class ScmInfoRepositoryImplTest {
 
     verifyNoMoreInteractions(dbLoader);
     verifyNoMoreInteractions(sourceHashRepository);
-    verifyZeroInteractions(diff);
+    verifyNoInteractions(diff);
   }
 
   @Test
@@ -178,8 +178,8 @@ public class ScmInfoRepositoryImplTest {
 
     verify(dbLoader).getScmInfo(FILE);
     verifyNoMoreInteractions(dbLoader);
-    verifyZeroInteractions(sourceHashRepository);
-    verifyZeroInteractions(diff);
+    verifyNoInteractions(sourceHashRepository);
+    verifyNoInteractions(diff);
   }
 
   @Test
@@ -195,8 +195,8 @@ public class ScmInfoRepositoryImplTest {
 
     verify(dbLoader).getScmInfo(FILE);
     verifyNoMoreInteractions(dbLoader);
-    verifyZeroInteractions(sourceHashRepository);
-    verifyZeroInteractions(diff);
+    verifyNoInteractions(sourceHashRepository);
+    verifyNoInteractions(diff);
   }
 
   @Test
@@ -214,7 +214,7 @@ public class ScmInfoRepositoryImplTest {
     verify(dbLoader).getScmInfo(FILE);
     verify(diff).computeMatchingLines(FILE);
     verifyNoMoreInteractions(dbLoader);
-    verifyZeroInteractions(sourceHashRepository);
+    verifyNoInteractions(sourceHashRepository);
     verifyNoMoreInteractions(diff);
   }
 
@@ -233,7 +233,7 @@ public class ScmInfoRepositoryImplTest {
 
     assertThat(underTest.getScmInfo(component)).isEmpty();
 
-    verifyZeroInteractions(batchReportReader, dbLoader);
+    verifyNoInteractions(batchReportReader, dbLoader);
   }
 
   @DataProvider
index 4b3a4369038a359b5e7455873da7ca2cbd6b9a7c..996ef8f8c2b1cfc2ec0f428a465183bb129d75a1 100644 (file)
@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 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.ce.task.projectanalysis.source.linereader.LineReader.Data.HIGHLIGHTING;
 import static org.sonar.ce.task.projectanalysis.source.linereader.LineReader.Data.SYMBOLS;
@@ -103,7 +103,7 @@ public class FileSourceDataWarningsTest {
 
     underTest.addWarning(file, readError);
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
@@ -125,7 +125,7 @@ public class FileSourceDataWarningsTest {
 
     Arrays.stream(readErrors).forEach(readError -> underTest.addWarning(file, readError));
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
@@ -148,7 +148,7 @@ public class FileSourceDataWarningsTest {
     Arrays.stream(files).forEach(file -> IntStream.range(0, 1 + random.nextInt(10))
       .forEach(i -> underTest.addWarning(file, new LineReader.ReadError(HIGHLIGHTING, line + i))));
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
@@ -173,7 +173,7 @@ public class FileSourceDataWarningsTest {
     Arrays.stream(files).forEach(file -> IntStream.range(0, 1 + random.nextInt(10))
       .forEach(i -> underTest.addWarning(file, new LineReader.ReadError(HIGHLIGHTING, line + i))));
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
@@ -195,7 +195,7 @@ public class FileSourceDataWarningsTest {
 
     underTest.addWarning(file, readError);
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
@@ -217,7 +217,7 @@ public class FileSourceDataWarningsTest {
 
     Arrays.stream(readErrors).forEach(readError -> underTest.addWarning(file, readError));
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
@@ -240,7 +240,7 @@ public class FileSourceDataWarningsTest {
     Arrays.stream(files).forEach(file -> IntStream.range(0, 1 + random.nextInt(10))
       .forEach(i -> underTest.addWarning(file, new LineReader.ReadError(SYMBOLS, line + i))));
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
@@ -265,7 +265,7 @@ public class FileSourceDataWarningsTest {
     Arrays.stream(files).forEach(file -> IntStream.range(0, 1 + random.nextInt(10))
       .forEach(i -> underTest.addWarning(file, new LineReader.ReadError(SYMBOLS, line + i))));
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
@@ -288,11 +288,11 @@ public class FileSourceDataWarningsTest {
 
     underTest.addWarning(file, readError);
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
 
     underTest.commitWarnings();
 
-    verifyZeroInteractions(taskMessages);
+    verifyNoInteractions(taskMessages);
   }
 
   @DataProvider
index 1de96a53e475f66ec97a0231300797e1f4b312f1..14dd900d84a5a12f6584a59050904e13a5c5d424 100644 (file)
@@ -41,8 +41,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
 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 LineReadersImplTest {
@@ -62,7 +62,7 @@ public class LineReadersImplTest {
     verify(c1).close();
     verify(c2).close();
     verifyNoMoreInteractions(c1, c2);
-    verifyZeroInteractions(r1, r2);
+    verifyNoInteractions(r1, r2);
   }
 
   @Test
@@ -79,7 +79,7 @@ public class LineReadersImplTest {
     verify(r1).read(builder);
     verify(r2).read(builder);
     verifyNoMoreInteractions(r1, r2);
-    verifyZeroInteractions(c1, c2);
+    verifyNoInteractions(c1, c2);
   }
 
   @Test
index d6defe33b3f1e5af89d0aea3a201a1e5910ace8f..42b85f092ee9920400eb84c8ef7263af294ecbd5 100644 (file)
@@ -40,8 +40,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;
 
 public class SourceLinesHashRepositoryImplTest {
@@ -73,7 +73,7 @@ public class SourceLinesHashRepositoryImplTest {
 
     verify(significantCodeRepository).getRangesPerLine(file);
     verifyNoMoreInteractions(significantCodeRepository);
-    verifyZeroInteractions(dbLineHashVersion);
+    verifyNoInteractions(dbLineHashVersion);
   }
 
   @Test
@@ -83,7 +83,7 @@ public class SourceLinesHashRepositoryImplTest {
 
     verify(significantCodeRepository).getRangesPerLine(file);
     verifyNoMoreInteractions(significantCodeRepository);
-    verifyZeroInteractions(dbLineHashVersion);
+    verifyNoInteractions(dbLineHashVersion);
   }
 
   @Test
@@ -94,7 +94,7 @@ public class SourceLinesHashRepositoryImplTest {
     assertLineHashes(lineHashes, "line1", "line2", "line3");
     verify(dbLineHashVersion).hasLineHashesWithoutSignificantCode(file);
     verifyNoMoreInteractions(dbLineHashVersion);
-    verifyZeroInteractions(significantCodeRepository);
+    verifyNoInteractions(significantCodeRepository);
   }
 
   @Test
@@ -135,7 +135,7 @@ public class SourceLinesHashRepositoryImplTest {
 
     verify(significantCodeRepository).getRangesPerLine(file);
     verifyNoMoreInteractions(significantCodeRepository);
-    verifyZeroInteractions(dbLineHashVersion);
+    verifyNoInteractions(dbLineHashVersion);
   }
 
   @Test
@@ -145,7 +145,7 @@ public class SourceLinesHashRepositoryImplTest {
 
     verify(significantCodeRepository).getRangesPerLine(file);
     verifyNoMoreInteractions(significantCodeRepository);
-    verifyZeroInteractions(dbLineHashVersion);
+    verifyNoInteractions(dbLineHashVersion);
   }
 
   @Test
index 2824982e79217ac15eb27f586cdd13ab976bb7b6..ce62cb4792dfda9e1aac1d976337637c1c534aa8 100644 (file)
@@ -59,7 +59,6 @@ import static org.mockito.Mockito.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.ce.task.projectanalysis.component.Component.Type.FILE;
 import static org.sonar.ce.task.projectanalysis.component.Component.Type.PROJECT;
@@ -285,7 +284,7 @@ public class LoadCrossProjectDuplicationsRepositoryStepTest {
 
     underTest.execute(new TestComputationStepContext());
 
-    verifyZeroInteractions(integrateCrossProjectDuplications);
+    verifyNoInteractions(integrateCrossProjectDuplications);
   }
 
   @Test
index 31b7ef6129e419ff4c50a67f83ddc858543425be..f927975e47230345b932f744b91db0c3ced1dbf6 100644 (file)
@@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.scanner.protocol.output.ScannerReport.ComponentLink.ComponentLinkType.CI;
 import static org.sonar.scanner.protocol.output.ScannerReport.ComponentLink.ComponentLinkType.HOME;
@@ -82,7 +82,7 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
 
     underTest.execute(new TestComputationStepContext());
 
-    verifyZeroInteractions(uuidFactory, reportReader, treeRootHolder, dbClient);
+    verifyNoInteractions(uuidFactory, reportReader, treeRootHolder, dbClient);
   }
 
   @Test
index 2b6db31d49d8ea93d101d1c9df490188aeba74ba..a68cff2659ac6544d65d42b22f62c861d707c6e2 100644 (file)
@@ -53,8 +53,8 @@ import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 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;
 import static org.sonar.api.measures.CoreMetrics.ALERT_STATUS_KEY;
 import static org.sonar.ce.task.projectanalysis.measure.Measure.Level.ERROR;
@@ -286,6 +286,6 @@ public class QualityGateEventsStepTest {
 
     underTest.execute(new TestComputationStepContext());
 
-    verifyZeroInteractions(treeRootHolder, metricRepository, measureRepository, eventRepository, notificationService);
+    verifyNoInteractions(treeRootHolder, metricRepository, measureRepository, eventRepository, notificationService);
   }
 }
index 18e593ac0a940996314b8005df4143be97f7b5bf..b173eff874ae2f84797c096d57acb8b28f8107f6 100644 (file)
@@ -91,8 +91,8 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 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;
 import static org.sonar.api.rules.RuleType.SECURITY_HOTSPOT;
 import static org.sonar.ce.task.projectanalysis.component.Component.Type;
@@ -284,7 +284,7 @@ public class SendIssueNotificationsStepTest extends BaseStepTest {
     TestComputationStepContext context = new TestComputationStepContext();
     underTest.execute(context);
 
-    verifyZeroInteractions(notificationService, newIssuesNotificationMock);
+    verifyNoInteractions(notificationService, newIssuesNotificationMock);
   }
 
   private DefaultIssue createIssue() {
index 224e94c1f370283fd7c8a0801693da2778d91c1e..9f673a6f9138aee69a1341f8bd1cdbfb2bb8fa8e 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.server.project.Project;
 
 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 TriggerViewRefreshStepTest {
@@ -39,7 +39,7 @@ public class TriggerViewRefreshStepTest {
 
     underTest.execute(new TestComputationStepContext());
 
-    verifyZeroInteractions(analysisMetadataHolder);
+    verifyNoInteractions(analysisMetadataHolder);
   }
 
   @Test
@@ -48,7 +48,7 @@ public class TriggerViewRefreshStepTest {
 
     underTest.execute(new TestComputationStepContext());
 
-    verifyZeroInteractions(analysisMetadataHolder);
+    verifyNoInteractions(analysisMetadataHolder);
   }
 
   @Test
index 298e4c5603d67c4b487c85dfe5e9e7fbd2c42c0c..c1ed19c0ce008f330d5f8fa796c37b61f629180c 100644 (file)
@@ -41,7 +41,7 @@ import org.sonar.db.MyBatis;
 import org.sonar.db.source.FileSourceDto;
 
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doCallRealMethod;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verifyNoInteractions;
index 80fd022d55c8bc46a7141fd4f46fcb46d281200d..a10b35cd3edb9118c1a44556cf3f487dab18c813 100644 (file)
@@ -43,7 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.assertj.core.api.Assertions.tuple;
 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 CeTaskMessagesImplTest {
@@ -113,7 +113,7 @@ public class CeTaskMessagesImplTest {
 
     underTest.addAll(Collections.emptyList());
 
-    verifyZeroInteractions(dbClientMock, uuidFactoryMock, ceTaskMock);
+    verifyNoInteractions(dbClientMock, uuidFactoryMock, ceTaskMock);
   }
 
   @Test
index 3a06182c1f13b0213f31a6f0f0865a25e58ba0c1..c6e1c68f238a9d49f7d91100d8ebada9f19b72a6 100644 (file)
@@ -26,7 +26,7 @@ import org.sonar.db.DbClient;
 
 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;
 
 public class DistributedCEQueueStatusImplTest extends CommonCEQueueStatusImplTest {
   private DistributedCEQueueStatusImpl underTest = new DistributedCEQueueStatusImpl(getDbClient(), mock(System2.class));
@@ -44,6 +44,6 @@ public class DistributedCEQueueStatusImplTest extends CommonCEQueueStatusImplTes
   public void getPendingCount_returns_0_without_querying_database() {
     assertThat(underTest.getPendingCount()).isZero();
 
-    verifyZeroInteractions(getDbClient());
+    verifyNoInteractions(getDbClient());
   }
 }
index d4a5de2dacc248e59c1f20482a72d560446e6712..7881515469414ffad382b6814c1141469671a2da 100644 (file)
@@ -55,7 +55,7 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.same;
 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.db.component.ComponentTesting.newDirectory;
 import static org.sonar.db.component.ComponentTesting.newModuleDto;
@@ -89,14 +89,14 @@ public class ReportAnalysisFailureNotificationExecutionListenerTest {
 
     fullMockedUnderTest.onStart(mockedCeTask);
 
-    verifyZeroInteractions(mockedCeTask, notificationService, dbClientMock, serializer, system2);
+    verifyNoInteractions(mockedCeTask, notificationService, dbClientMock, serializer, system2);
   }
 
   @Test
   public void onEnd_has_no_effect_if_status_is_SUCCESS() {
     fullMockedUnderTest.onEnd(ceTaskMock, CeActivityDto.Status.SUCCESS, randomDuration(), ceTaskResultMock, throwableMock);
 
-    verifyZeroInteractions(ceTaskMock, ceTaskResultMock, throwableMock, notificationService, dbClientMock, serializer, system2);
+    verifyNoInteractions(ceTaskMock, ceTaskResultMock, throwableMock, notificationService, dbClientMock, serializer, system2);
   }
 
   @Test
@@ -105,7 +105,7 @@ public class ReportAnalysisFailureNotificationExecutionListenerTest {
 
     fullMockedUnderTest.onEnd(ceTaskMock, CeActivityDto.Status.FAILED, randomDuration(), ceTaskResultMock, throwableMock);
 
-    verifyZeroInteractions(ceTaskResultMock, throwableMock, notificationService, dbClientMock, serializer, system2);
+    verifyNoInteractions(ceTaskResultMock, throwableMock, notificationService, dbClientMock, serializer, system2);
   }
 
   @Test
@@ -114,7 +114,7 @@ public class ReportAnalysisFailureNotificationExecutionListenerTest {
 
     fullMockedUnderTest.onEnd(ceTaskMock, CeActivityDto.Status.FAILED, randomDuration(), ceTaskResultMock, throwableMock);
 
-    verifyZeroInteractions(ceTaskResultMock, throwableMock, notificationService, dbClientMock, serializer, system2);
+    verifyNoInteractions(ceTaskResultMock, throwableMock, notificationService, dbClientMock, serializer, system2);
   }
 
   @Test
@@ -127,7 +127,7 @@ public class ReportAnalysisFailureNotificationExecutionListenerTest {
 
     fullMockedUnderTest.onEnd(ceTaskMock, CeActivityDto.Status.FAILED, randomDuration(), ceTaskResultMock, throwableMock);
 
-    verifyZeroInteractions(ceTaskResultMock, throwableMock, dbClientMock, serializer, system2);
+    verifyNoInteractions(ceTaskResultMock, throwableMock, dbClientMock, serializer, system2);
   }
 
   @Test
@@ -263,7 +263,7 @@ public class ReportAnalysisFailureNotificationExecutionListenerTest {
     underTest.onEnd(ceTaskMock, CeActivityDto.Status.FAILED, randomDuration(), ceTaskResultMock, null);
 
     verify(notificationService).deliver(same(notificationMock));
-    verifyZeroInteractions(ceTaskResultMock);
+    verifyNoInteractions(ceTaskResultMock);
   }
 
   @Test
index 88db4265c7a9508ecad25ac42d74c6560a628b90..689e43b931ad3ffa417a90594f861bc91c1c592f 100644 (file)
@@ -30,8 +30,8 @@ import org.sonar.server.platform.db.migration.version.DatabaseVersion;
 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.verifyNoInteractions;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.server.platform.db.migration.version.DatabaseVersion.Status.FRESH_INSTALL;
 import static org.sonar.server.platform.db.migration.version.DatabaseVersion.Status.UP_TO_DATE;
@@ -84,6 +84,6 @@ public class DatabaseCompatibilityTest {
   public void stop_has_no_effect() {
     underTest.stop();
 
-    verifyZeroInteractions(databaseVersion);
+    verifyNoInteractions(databaseVersion);
   }
 }
index bdc737ef294a0019ce30f241956feb74ff34bc81..1f1b1cd12113e15d31d6c7c3785b1cf7275a0427 100644 (file)
@@ -28,7 +28,7 @@ import org.sonar.ce.taskprocessor.CeProcessingScheduler;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 
 public class CeQueueInitializerTest {
 
@@ -52,7 +52,7 @@ public class CeQueueInitializerTest {
 
     underTest.onServerStart(server);
 
-    verifyZeroInteractions(processingScheduler, cleaningScheduler);
+    verifyNoInteractions(processingScheduler, cleaningScheduler);
 
   }
 }
index 53ce5b2832de3f2d2e5ec8fe5c15a3802c0c7fed..935948712d7ce2a373f80646c8ace5402a2150e0 100644 (file)
@@ -56,7 +56,7 @@ import static org.assertj.core.api.Assertions.fail;
 import static org.mockito.ArgumentMatchers.anyLong;
 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.ce.container.ComputeEngineStatus.Status.STARTED;
 import static org.sonar.ce.container.ComputeEngineStatus.Status.STOPPING;
@@ -281,7 +281,7 @@ public class InternalCeQueueImplTest {
     underTest.cancelWornOuts();
 
     assertThat(db.getDbClient().ceActivityDao().selectByUuid(db.getSession(), task.getUuid())).isPresent();
-    verifyZeroInteractions(queueStatusMock);
+    verifyNoInteractions(queueStatusMock);
   }
 
   private static class TypedExceptionImpl extends RuntimeException implements TypedException {
index 2c8e474ff390eedd019e76571e832b816ea79f46..77a09c45ee404cacd7b051bbd4d7c95b0a016e75 100644 (file)
@@ -69,7 +69,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.times;
 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.ce.taskprocessor.CeWorker.Result.DISABLED;
 import static org.sonar.ce.taskprocessor.CeWorker.Result.NO_TASK;
@@ -128,7 +128,7 @@ public class CeWorkerImplTest {
 
     assertThat(underTest.call()).isEqualTo(DISABLED);
 
-    verifyZeroInteractions(taskProcessor, executionListener1, executionListener2);
+    verifyNoInteractions(taskProcessor, executionListener1, executionListener2);
   }
 
   @Test
@@ -138,7 +138,7 @@ public class CeWorkerImplTest {
 
     assertThat(underTestNoListener.call()).isEqualTo(DISABLED);
 
-    verifyZeroInteractions(taskProcessor, executionListener1, executionListener2);
+    verifyNoInteractions(taskProcessor, executionListener1, executionListener2);
   }
 
   @Test
@@ -147,7 +147,7 @@ public class CeWorkerImplTest {
 
     assertThat(underTest.call()).isEqualTo(NO_TASK);
 
-    verifyZeroInteractions(taskProcessor, executionListener1, executionListener2);
+    verifyNoInteractions(taskProcessor, executionListener1, executionListener2);
   }
 
   @Test
@@ -156,7 +156,7 @@ public class CeWorkerImplTest {
 
     assertThat(underTestNoListener.call()).isEqualTo(NO_TASK);
 
-    verifyZeroInteractions(taskProcessor, executionListener1, executionListener2);
+    verifyNoInteractions(taskProcessor, executionListener1, executionListener2);
   }
 
   @Test
index fc2b0ff5961333801ecd5b396f60823c9c42941e..a1fac0ac5effa30ac040d12ed4417f6b8c705e78 100644 (file)
@@ -26,7 +26,7 @@ import org.sonar.ce.task.CeTaskCanceledException;
 import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 
 public class SimpleCeTaskInterrupterTest {
 
@@ -60,7 +60,7 @@ public class SimpleCeTaskInterrupterTest {
 
     underTest.onStart(ceTask);
 
-    verifyZeroInteractions(ceTask);
+    verifyNoInteractions(ceTask);
   }
 
   @Test
@@ -69,6 +69,6 @@ public class SimpleCeTaskInterrupterTest {
 
     underTest.onEnd(ceTask);
 
-    verifyZeroInteractions(ceTask);
+    verifyNoInteractions(ceTask);
   }
 }
index de70c5ebfc12a7c9fae430a11afbb6101a8c705d..24f0862791c59f4c8a0eccc8f8027d259f3664b1 100644 (file)
@@ -44,8 +44,8 @@ import org.sonar.api.utils.System2;
 import org.sonar.core.util.CloseableIterator;
 import org.sonar.core.util.UuidFactoryFast;
 import org.sonar.core.util.Uuids;
-import org.sonar.db.DbInputStream;
 import org.sonar.db.DbClient;
+import org.sonar.db.DbInputStream;
 import org.sonar.db.DbSession;
 import org.sonar.db.DbTester;
 import org.sonar.db.alm.setting.AlmSettingDto;
@@ -92,7 +92,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.groups.Tuple.tuple;
 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.db.ce.CeTaskTypes.REPORT;
 import static org.sonar.db.component.ComponentTesting.newBranchDto;
@@ -1443,7 +1443,7 @@ public class PurgeDaoTest {
 
     underTest.deleteNonRootComponentsInView(dbSession, Collections.emptyList());
 
-    verifyZeroInteractions(dbSession);
+    verifyNoInteractions(dbSession);
   }
 
   @Test
@@ -1483,7 +1483,7 @@ public class PurgeDaoTest {
     Collections.shuffle(componentDtos); // order of collection must not matter
     underTest.deleteNonRootComponentsInView(dbSession, componentDtos);
 
-    verifyZeroInteractions(dbSession);
+    verifyNoInteractions(dbSession);
   }
 
   @Test
index d0fb3c8f5232d686ae9f193faec402ac7b4efd65..e6e53579e625489a99f56f39b7fa50f95c8acbd1 100644 (file)
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyString;
 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 OracleCharsetHandlerTest {
@@ -52,7 +52,7 @@ public class OracleCharsetHandlerTest {
   public void upgrade_does_not_verify_utf8_charset() throws Exception {
     underTest.handle(connection, DatabaseCharsetChecker.State.UPGRADE);
 
-    verifyZeroInteractions(sqlExecutor);
+    verifyNoInteractions(sqlExecutor);
   }
 
   @Test
@@ -82,7 +82,7 @@ public class OracleCharsetHandlerTest {
   @Test
   public void does_nothing_if_regular_startup() throws Exception {
     underTest.handle(connection, DatabaseCharsetChecker.State.STARTUP);
-    verifyZeroInteractions(sqlExecutor);
+    verifyNoInteractions(sqlExecutor);
   }
 
   private void answerCharset(@Nullable String charset) throws SQLException {
index 0e2047d17b42869ea9a0a4daf9f27f1742b68c1f..49bc05d3562b3ac3a1ce5c98b15b46ece516f4a3 100644 (file)
@@ -33,7 +33,7 @@ import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.same;
 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 PostgresCharsetHandlerTest {
@@ -56,7 +56,7 @@ public class PostgresCharsetHandlerTest {
     underTest.handle(connection, DatabaseCharsetChecker.State.FRESH_INSTALL);
     // no errors, charset has been verified
     verify(metadata).getDefaultCharset(same(connection));
-    verifyZeroInteractions(sqlExecutor);
+    verifyNoInteractions(sqlExecutor);
   }
 
   @Test
index f0b31e5c9aa189cb4b2d8ae077ecd77c750d8acb..b8fb2913036c6b757d03743f1387cd7015081d0b 100644 (file)
@@ -42,7 +42,6 @@ import static org.junit.Assert.fail;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 
 public class MigrationEngineImplTest {
index 63edbf850642965d87e35f2567e514458ef54b98..f6b2cd8cb5592ee31f7c35a0ab235dd013e0064b 100644 (file)
@@ -25,7 +25,7 @@ import org.sonar.db.CoreDbTester;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 
 public class NoTableMigrationHistoryImplTest {
   @Rule
@@ -38,7 +38,7 @@ public class NoTableMigrationHistoryImplTest {
   public void start_fails_with_ISE_if_table_history_does_not_exist() {
     assertThatThrownBy(() -> {
       underTest.start();
-      verifyZeroInteractions(migrationHistoryMeddler);
+      verifyNoInteractions(migrationHistoryMeddler);
     })
       .isInstanceOf(IllegalStateException.class)
       .hasMessage("Migration history table is missing");
index 2b6bc10ad0d475fef82684a4d88a9af0af3f9461..344de801487d3a295346b999c02f02a9860ba1ab 100644 (file)
@@ -32,7 +32,7 @@ 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.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.process.ProcessProperties.Property.CLUSTER_ENABLED;
 import static org.sonar.process.ProcessProperties.Property.PATH_DATA;
@@ -72,9 +72,9 @@ public class AppReloaderImplTest {
     assertThatThrownBy(() -> {
       underTest.reload(settings);
 
-      verifyZeroInteractions(logging);
-      verifyZeroInteractions(state);
-      verifyZeroInteractions(fs);
+      verifyNoInteractions(logging);
+      verifyNoInteractions(state);
+      verifyNoInteractions(fs);
     })
       .isInstanceOf(IllegalStateException.class)
       .hasMessage("Restart is not possible with cluster mode");
@@ -101,9 +101,9 @@ public class AppReloaderImplTest {
     assertThatThrownBy(() -> {
       underTest.reload(settings);
 
-      verifyZeroInteractions(logging);
-      verifyZeroInteractions(state);
-      verifyZeroInteractions(fs);
+      verifyNoInteractions(logging);
+      verifyNoInteractions(state);
+      verifyNoInteractions(fs);
     })
       .isInstanceOf(MessageException.class)
       .hasMessage("Property [" + propertyKey + "] cannot be changed on restart: [val1] => [val2]");
index d72b8e4d3be08e328a9282b40cf57311277002d7..2bc314c09e6ce41c287db23948af1c97dc248aed 100644 (file)
@@ -34,7 +34,7 @@ import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 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.slf4j.event.Level.DEBUG;
 import static org.slf4j.event.Level.ERROR;
@@ -91,7 +91,7 @@ public class HealthStateRefresherTest {
     underTest.stop();
 
     verify(sharedHealthState).clearMine();
-    verifyZeroInteractions(executorService, nodeHealthProvider);
+    verifyNoInteractions(executorService, nodeHealthProvider);
   }
 
   @Test
index 3df4ade37de3b7d2687c5e41afa7ce04e2a3e3b1..be531373b424268727366504736fddc632fb40ce 100644 (file)
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.server.es.searchrequest.TopAggregationHelper.NO_EXTRA_FILTER;
 import static org.sonar.server.es.searchrequest.TopAggregationHelper.NO_OTHER_SUBAGGREGATION;
@@ -139,7 +139,7 @@ public class TopAggregationHelperTest {
 
     underTest.buildTopAggregation(topAggregationName, topAggregation, NO_EXTRA_FILTER, t -> t.subAggregation(subAggregation));
 
-    verifyZeroInteractions(subAggregationHelper);
+    verifyNoInteractions(subAggregationHelper);
   }
 
   @Test
index fa5eb7a58c1edb694cf6c5f759f29f63f3ac8293..83477da167dcaf6b9ebf2f15f530535169d41258 100644 (file)
@@ -55,8 +55,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.anySet;
 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;
 import static org.sonar.core.util.stream.MoreCollectors.index;
 import static org.sonar.core.util.stream.MoreCollectors.unorderedIndex;
@@ -116,7 +116,7 @@ public class ChangesOnMyIssueNotificationHandlerTest {
     int deliver = underTest.deliver(Collections.emptyList());
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager, emailNotificationChannel);
+    verifyNoInteractions(notificationManager, emailNotificationChannel);
   }
 
   @Test
@@ -129,10 +129,10 @@ public class ChangesOnMyIssueNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
   @Test
@@ -151,7 +151,7 @@ public class ChangesOnMyIssueNotificationHandlerTest {
     int deliver = underTest.deliver(ImmutableSet.of(serializer.serialize(builder)));
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
   }
@@ -182,7 +182,7 @@ public class ChangesOnMyIssueNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
   }
index 318c105cc1af4b494756c3f952b1b459b0fd4f56..1a32c475fa5391852f288df0ee1e2c65e0743b4b 100644 (file)
@@ -57,8 +57,8 @@ import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.spy;
 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;
 import static org.sonar.api.issue.Issue.RESOLUTION_FALSE_POSITIVE;
 import static org.sonar.api.issue.Issue.RESOLUTION_WONT_FIX;
@@ -120,10 +120,10 @@ public class FPOrWontFixNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
   @Test
@@ -176,9 +176,9 @@ public class FPOrWontFixNotificationHandlerTest {
 
     assertThat(deliver).isZero();
     verify(serializer, times(notifications.size())).from(any(IssuesChangesNotification.class));
-    verifyZeroInteractions(changeMock);
+    verifyNoInteractions(changeMock);
     verifyNoMoreInteractions(serializer);
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
   }
@@ -198,9 +198,9 @@ public class FPOrWontFixNotificationHandlerTest {
 
     assertThat(deliver).isZero();
     verify(serializer, times(notifications.size())).from(any(IssuesChangesNotification.class));
-    verifyZeroInteractions(changeMock);
+    verifyNoInteractions(changeMock);
     verifyNoMoreInteractions(serializer);
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
   }
@@ -257,7 +257,7 @@ public class FPOrWontFixNotificationHandlerTest {
     verifyNoMoreInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
-    verifyZeroInteractions(changeMock);
+    verifyNoInteractions(changeMock);
   }
 
   @Test
index 56f155d8380ebfcce56b3e2e1fc9fcd4f445ae83..6e3684715a854da0a2ceb45bb8cf18075f8bea37 100644 (file)
@@ -41,8 +41,8 @@ import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 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;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBAL_NOTIFICATION;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
@@ -92,7 +92,7 @@ public class MyNewIssuesNotificationHandlerTest {
     int deliver = underTest.deliver(Collections.emptyList());
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager, emailNotificationChannel);
+    verifyNoInteractions(notificationManager, emailNotificationChannel);
   }
 
   @Test
@@ -105,10 +105,10 @@ public class MyNewIssuesNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
   @Test
@@ -121,7 +121,7 @@ public class MyNewIssuesNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
     notifications.forEach(notification -> {
@@ -140,7 +140,7 @@ public class MyNewIssuesNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
     notifications.forEach(notification -> {
index b90f93b78a46afb60c415836bfc9e09ae216be22..5abc5adc698cfd0f7401210ebbb9d3d85f199977 100644 (file)
@@ -40,8 +40,8 @@ import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 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;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBAL_NOTIFICATION;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
@@ -90,7 +90,7 @@ public class NewIssuesNotificationHandlerTest {
     int deliver = underTest.deliver(Collections.emptyList());
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager, emailNotificationChannel);
+    verifyNoInteractions(notificationManager, emailNotificationChannel);
   }
 
   @Test
@@ -103,10 +103,10 @@ public class NewIssuesNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
   @Test
@@ -119,7 +119,7 @@ public class NewIssuesNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
     notifications.forEach(notification -> {
index a39d505306b59d898f9944731522c1dd28fc09fc..546a2997297de34e5e96a47d1657c792cb0ed0a5 100644 (file)
@@ -40,8 +40,8 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 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;
 
 public class NotificationServiceTest {
@@ -75,7 +75,7 @@ public class NotificationServiceTest {
     NotificationService underTest = new NotificationService(dbClient);
 
     assertThat(underTest.deliverEmails(notifications)).isZero();
-    verifyZeroInteractions(dbClient);
+    verifyNoInteractions(dbClient);
   }
 
   @Test
@@ -87,8 +87,8 @@ public class NotificationServiceTest {
     NotificationService underTest = new NotificationService(dbClient, new NotificationDispatcher[] {dispatcher});
 
     assertThat(underTest.deliverEmails(notifications)).isZero();
-    verifyZeroInteractions(dispatcher);
-    verifyZeroInteractions(dbClient);
+    verifyNoInteractions(dispatcher);
+    verifyNoInteractions(dbClient);
   }
 
   @Test
@@ -99,7 +99,7 @@ public class NotificationServiceTest {
       new NotificationHandler[] {handler1, handler2});
 
     assertThat(underTest.deliverEmails(Collections.emptyList())).isZero();
-    verifyZeroInteractions(handler1, handler2);
+    verifyNoInteractions(handler1, handler2);
   }
 
   @Test
index ed795d13d2fc4dfcb8e40cd9fb42100181bd4f03..41d3689b05e5d1a0e5357096988509cbe4d81725 100644 (file)
@@ -38,8 +38,8 @@ import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 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;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.GLOBAL_NOTIFICATION;
 import static org.sonar.server.notification.NotificationDispatcherMetadata.PER_PROJECT_NOTIFICATION;
@@ -88,7 +88,7 @@ public class QGChangeNotificationHandlerTest {
     int deliver = underTest.deliver(Collections.emptyList());
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager, emailNotificationChannel);
+    verifyNoInteractions(notificationManager, emailNotificationChannel);
   }
 
   @Test
@@ -101,10 +101,10 @@ public class QGChangeNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
   @Test
@@ -117,7 +117,7 @@ public class QGChangeNotificationHandlerTest {
     int deliver = underTest.deliver(notifications);
 
     assertThat(deliver).isZero();
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
     notifications.forEach(notification -> {
index 01fdf0140ab6b0eb3189a70da69ffbd6fbadaea4..cd83615d99b7e16e2b25c82a1e512b33de84734b 100644 (file)
@@ -56,8 +56,8 @@ import static org.mockito.ArgumentMatchers.same;
 import static org.mockito.Mockito.doThrow;
 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 QGChangeEventListenersImplTest {
@@ -83,14 +83,14 @@ public class QGChangeEventListenersImplTest {
   public void broadcastOnIssueChange_has_no_effect_when_issues_are_empty() {
     underTest.broadcastOnIssueChange(emptyList(), singletonList(component1QGChangeEvent));
 
-    verifyZeroInteractions(listener1, listener2, listener3);
+    verifyNoInteractions(listener1, listener2, listener3);
   }
 
   @Test
   public void broadcastOnIssueChange_has_no_effect_when_no_changeEvent() {
     underTest.broadcastOnIssueChange(oneIssueOnComponent1, emptySet());
 
-    verifyZeroInteractions(listener1, listener2, listener3);
+    verifyNoInteractions(listener1, listener2, listener3);
   }
 
   @Test
@@ -171,7 +171,7 @@ public class QGChangeEventListenersImplTest {
 
     underTest.broadcastOnIssueChange(oneIssueOnComponent1, singletonList(component1QGChangeEvent));
 
-    verifyZeroInteractions(listener1, listener2, listener3);
+    verifyNoInteractions(listener1, listener2, listener3);
   }
 
   @Test
index b83866f91f7c26f52de916cd5970b0971df0469f..d80ff6aa19389d644b151a8c8dca831bf789fc57 100644 (file)
@@ -38,8 +38,8 @@ 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.verifyNoInteractions;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC_TOKEN;
@@ -98,7 +98,7 @@ public class BasicAuthenticationTest {
   public void does_not_authenticate_when_no_authorization_header() {
     underTest.authenticate(request);
 
-    verifyZeroInteractions(credentialsAuthentication, authenticationEvent);
+    verifyNoInteractions(credentialsAuthentication, authenticationEvent);
   }
 
   @Test
@@ -107,7 +107,7 @@ public class BasicAuthenticationTest {
 
     underTest.authenticate(request);
 
-    verifyZeroInteractions(credentialsAuthentication, authenticationEvent);
+    verifyNoInteractions(credentialsAuthentication, authenticationEvent);
   }
 
   @Test
@@ -118,7 +118,7 @@ public class BasicAuthenticationTest {
       .isInstanceOf(AuthenticationException.class)
       .hasFieldOrPropertyWithValue("source", Source.local(BASIC));
 
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -154,7 +154,7 @@ public class BasicAuthenticationTest {
       .isInstanceOf(AuthenticationException.class)
       .hasFieldOrPropertyWithValue("source", Source.local(BASIC_TOKEN));
 
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -167,7 +167,7 @@ public class BasicAuthenticationTest {
       .isInstanceOf(AuthenticationException.class)
       .hasFieldOrPropertyWithValue("source", Source.local(BASIC_TOKEN));
 
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -181,7 +181,7 @@ public class BasicAuthenticationTest {
       .isInstanceOf(AuthenticationException.class)
       .hasFieldOrPropertyWithValue("source", Source.local(BASIC_TOKEN));
 
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   private static String toBase64(String text) {
index 02661e1ff2a8c2b1da33e0dfceeadc0a8d5f60aa..e343190c73421ce34a4a6e27f609bfa0b627a31a 100644 (file)
@@ -40,8 +40,8 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doThrow;
 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;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC_TOKEN;
@@ -190,7 +190,7 @@ public class CredentialsExternalAuthenticationTest {
       .hasFieldOrPropertyWithValue("source", Source.realm(BASIC, REALM_NAME))
       .hasFieldOrPropertyWithValue("login", LOGIN);
 
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -206,7 +206,7 @@ public class CredentialsExternalAuthenticationTest {
       .hasFieldOrPropertyWithValue("source", Source.realm(BASIC, REALM_NAME))
       .hasFieldOrPropertyWithValue("login", LOGIN);
 
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
 
   }
 
@@ -224,7 +224,7 @@ public class CredentialsExternalAuthenticationTest {
       .hasFieldOrPropertyWithValue("source", Source.realm(BASIC_TOKEN, REALM_NAME))
       .hasFieldOrPropertyWithValue("login", LOGIN);
 
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
index 34de3ae50e6e53663fa90c5f581c71f0cb8e8616..6a8b42ab979a14064c29d23799a106d717c29a8e 100644 (file)
@@ -55,7 +55,7 @@ import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 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.db.user.UserTesting.newUserDto;
 
@@ -207,7 +207,7 @@ public class HttpHeadersAuthenticationTest {
     // User is not updated
     verifyUserInDb(DEFAULT_LOGIN, DEFAULT_NAME, DEFAULT_EMAIL, group1);
     verifyTokenIsNotUpdated();
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -255,7 +255,7 @@ public class HttpHeadersAuthenticationTest {
     // User is not updated
     verifyUserInDb(DEFAULT_LOGIN, DEFAULT_NAME, DEFAULT_EMAIL, group1);
     verifyTokenIsNotUpdated();
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -325,7 +325,7 @@ public class HttpHeadersAuthenticationTest {
 
     verifyUserNotAuthenticated();
     verifyTokenIsNotUpdated();
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -335,7 +335,7 @@ public class HttpHeadersAuthenticationTest {
     underTest.authenticate(createRequest(DEFAULT_LOGIN, DEFAULT_NAME, DEFAULT_EMAIL, GROUPS), response);
 
     verifyUserNotAuthenticated();
-    verifyZeroInteractions(jwtHttpHandler, authenticationEvent);
+    verifyNoInteractions(jwtHttpHandler, authenticationEvent);
   }
 
   @Test
@@ -348,7 +348,7 @@ public class HttpHeadersAuthenticationTest {
       .isInstanceOf(AuthenticationException.class)
       .hasFieldOrPropertyWithValue("source", Source.sso());
 
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   private void startWithSso() {
index fb162f465b802ec12c6be3497f7bf4ba0d1ac176..b37ce1bf893f0ad678379f9207c400d568a82bf0 100644 (file)
@@ -42,7 +42,7 @@ import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 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 InitFilterTest {
@@ -97,7 +97,7 @@ public class InitFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertOAuth2InitCalled();
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -108,7 +108,7 @@ public class InitFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertOAuth2InitCalled();
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -119,7 +119,7 @@ public class InitFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertBasicInitCalled();
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -150,8 +150,8 @@ public class InitFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertError("No provider key found in URI");
-    verifyZeroInteractions(authenticationEvent);
-    verifyZeroInteractions(auth2AuthenticationParameters);
+    verifyNoInteractions(authenticationEvent);
+    verifyNoInteractions(auth2AuthenticationParameters);
   }
 
   @Test
@@ -161,8 +161,8 @@ public class InitFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertError("No provider key found in URI");
-    verifyZeroInteractions(authenticationEvent);
-    verifyZeroInteractions(auth2AuthenticationParameters);
+    verifyNoInteractions(authenticationEvent);
+    verifyNoInteractions(auth2AuthenticationParameters);
   }
 
   @Test
@@ -175,8 +175,8 @@ public class InitFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertError("Unsupported IdentityProvider class: class org.sonar.server.authentication.InitFilterTest$UnsupportedIdentityProvider");
-    verifyZeroInteractions(authenticationEvent);
-    verifyZeroInteractions(auth2AuthenticationParameters);
+    verifyNoInteractions(authenticationEvent);
+    verifyNoInteractions(auth2AuthenticationParameters);
   }
 
   @Test
index 73afe2da1d57f12dd7dbdf580c9789bdb557dee7..f9912c29f8e062ccaab4ea78b1bbfddffa420bd4 100644 (file)
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.eq;
 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.server.authentication.event.AuthenticationEvent.Source;
 
@@ -136,7 +136,7 @@ public class OAuth2CallbackFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertError("Not an OAuth2IdentityProvider: class org.sonar.server.authentication.FakeBasicIdentityProvider");
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -147,7 +147,7 @@ public class OAuth2CallbackFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertError("Failed to retrieve IdentityProvider for key 'github'");
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -222,7 +222,7 @@ public class OAuth2CallbackFilterTest {
     underTest.doFilter(request, response, chain);
 
     assertError("No provider key found in URI");
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   private void assertCallbackCalled(FakeOAuth2IdentityProvider oAuth2IdentityProvider) {
index 37f9861e33c51148e9d3f5a2708b560ef10b1661..98f9db19d838cd1b1e17e4593c8c41ad2eaa1def 100644 (file)
@@ -35,7 +35,7 @@ import static java.util.Arrays.asList;
 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.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Method;
 import static org.sonar.server.authentication.event.AuthenticationEvent.Source;
@@ -80,7 +80,7 @@ public class AuthenticationEventImplTest {
 
     underTest.loginSuccess(request, "login", Source.sso());
 
-    verifyZeroInteractions(request);
+    verifyNoInteractions(request);
   }
 
   @Test
@@ -154,7 +154,7 @@ public class AuthenticationEventImplTest {
 
     underTest.loginFailure(request, exception);
 
-    verifyZeroInteractions(request, exception);
+    verifyNoInteractions(request, exception);
   }
 
   @Test
@@ -252,7 +252,7 @@ public class AuthenticationEventImplTest {
 
     underTest.logoutSuccess(request, "foo");
 
-    verifyZeroInteractions(request);
+    verifyNoInteractions(request);
   }
 
   @Test
@@ -317,7 +317,7 @@ public class AuthenticationEventImplTest {
 
     underTest.logoutFailure(request, "bad csrf");
 
-    verifyZeroInteractions(request);
+    verifyNoInteractions(request);
   }
 
   @Test
index e52f4db65d3a40d27453165282d6495edd3fb9ad..b31c7476c70e0430cf8ebbc19600e9cdf41cae97 100644 (file)
@@ -52,8 +52,8 @@ import static org.apache.commons.lang.RandomStringUtils.random;
 import static org.assertj.core.api.Assertions.assertThat;
 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;
 
 @RunWith(DataProviderRunner.class)
@@ -239,7 +239,7 @@ public class EmailNotificationChannelTest {
     int count = underTest.deliverAll(Collections.emptySet());
 
     assertThat(count).isZero();
-    verifyZeroInteractions(emailSettings);
+    verifyNoInteractions(emailSettings);
     assertThat(smtpServer.getMessages()).isEmpty();
   }
 
index 65a751a69bffa70b5bf46be89c88430e7ce7f840..8e92b826eda151c0880a76610dd6b774c7536fa6 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.server.platform.db.migration.engine.MigrationEngine;
 import static org.assertj.core.api.Assertions.assertThat;
 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 AutoDbMigrationTest {
@@ -84,7 +84,7 @@ public class AutoDbMigrationTest {
 
     underTest.start();
 
-    verifyZeroInteractions(migrationEngine);
+    verifyNoInteractions(migrationEngine);
     assertThat(logTester.logs(LoggerLevel.INFO)).isEmpty();
   }
 
@@ -108,7 +108,7 @@ public class AutoDbMigrationTest {
 
     underTest.start();
 
-    verifyZeroInteractions(migrationEngine);
+    verifyNoInteractions(migrationEngine);
     assertThat(logTester.logs(LoggerLevel.INFO)).isEmpty();
   }
 
index 23e4e7d3a30a0a57de158c18df863f90521efbbd..4e98d1f21368050ffd02e590bca25af83ff4bfcc 100644 (file)
@@ -60,7 +60,7 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 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.core.util.stream.MoreCollectors.toArrayList;
 import static org.sonar.db.component.BranchType.BRANCH;
@@ -94,7 +94,7 @@ public class WebhookQGChangeEventListenerTest {
     mockedUnderTest.onIssueChanges(qualityGateEvent, CHANGED_ISSUES_ARE_IGNORED);
 
     verify(webHooks).isEnabled(qualityGateEvent.getProject());
-    verifyZeroInteractions(webhookPayloadFactory, mockedDbClient);
+    verifyNoInteractions(webhookPayloadFactory, mockedDbClient);
   }
 
   @DataProvider
@@ -121,7 +121,7 @@ public class WebhookQGChangeEventListenerTest {
 
     underTest.onIssueChanges(qualityGateEvent, CHANGED_ISSUES_ARE_IGNORED);
 
-    verifyZeroInteractions(webhookPayloadFactory, mockedDbClient);
+    verifyNoInteractions(webhookPayloadFactory, mockedDbClient);
   }
 
   @Test
@@ -134,7 +134,7 @@ public class WebhookQGChangeEventListenerTest {
 
     underTest.onIssueChanges(qualityGateEvent, CHANGED_ISSUES_ARE_IGNORED);
 
-    verifyZeroInteractions(webhookPayloadFactory, mockedDbClient);
+    verifyNoInteractions(webhookPayloadFactory, mockedDbClient);
   }
 
   @Test
index c23c2eb856343cd5c1cacfc6e4fd251b13fdde60..660376121646cfab6d1ff6854bed4873b5ffe6bd 100644 (file)
@@ -48,7 +48,7 @@ import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doThrow;
 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.server.authentication.event.AuthenticationEvent.Method.FORM;
 
@@ -116,8 +116,8 @@ public class LoginActionTest {
     assertThat(threadLocalUserSession.isLoggedIn()).isTrue();
     verify(credentialsAuthentication).authenticate(new Credentials(LOGIN, PASSWORD), request, FORM);
     verify(jwtHttpHandler).generateToken(user, request, response);
-    verifyZeroInteractions(chain);
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(chain);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -126,8 +126,8 @@ public class LoginActionTest {
 
     underTest.doFilter(request, response, chain);
 
-    verifyZeroInteractions(credentialsAuthentication, jwtHttpHandler, chain);
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(credentialsAuthentication, jwtHttpHandler, chain);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
@@ -138,7 +138,7 @@ public class LoginActionTest {
 
     verify(response).setStatus(401);
     assertThat(threadLocalUserSession.hasSession()).isFalse();
-    verifyZeroInteractions(authenticationEvent);
+    verifyNoInteractions(authenticationEvent);
   }
 
   @Test
index 147bc72ccb43ff36e0832b689a91bc67132e882f..778ad2d13cde79f66b6a8ae6b41edecf219d3370 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.server.ws.WsActionTester;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.sonar.db.component.BranchType.PULL_REQUEST;
index 52c466dfb0acce19e4441c7da568a05d0f2c5194..8089d8e3402bd815770e91201e02aaa418c1402d 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.server.ws.WsActionTester;
 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;
 
 public class CancelAllActionTest {
 
@@ -56,7 +56,7 @@ public class CancelAllActionTest {
 
     assertThatThrownBy(() -> {
       call();
-      verifyZeroInteractions(queue);
+      verifyNoInteractions(queue);
     })
       .isInstanceOf(ForbiddenException.class)
       .hasMessage("Insufficient privileges");
index 72c7d3e70117f573a1042dd6eadc4caf9c37e931..99607f9c6e3c2c08512f3d337697f61b86e0f07c 100644 (file)
@@ -35,7 +35,7 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 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 CommentActionTest {
@@ -72,7 +72,7 @@ public class CommentActionTest {
     } catch (Exception e) {
       assertThat(e).isInstanceOf(IllegalArgumentException.class).hasMessage("Missing parameter : 'comment'");
     }
-    verifyZeroInteractions(issueUpdater);
+    verifyNoInteractions(issueUpdater);
   }
 
   @Test
index e55529f72257f863f6726e463ad7917d98c1a542..d8a70c3c71080c38e6832657814c0d50a85eb4ed 100644 (file)
@@ -52,7 +52,7 @@ import org.sonar.server.rule.DefaultRuleFinder;
 import static org.assertj.core.api.Assertions.assertThat;
 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.sonar.api.issue.Issue.RESOLUTION_FIXED;
 import static org.sonar.api.rule.Severity.BLOCKER;
 import static org.sonar.api.rule.Severity.MAJOR;
@@ -198,7 +198,7 @@ public class IssueUpdaterTest {
 
     underTest.saveIssueAndPreloadSearchResponseData(db.getSession(), issue, context, false);
 
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
   }
 
   @Test
@@ -212,7 +212,7 @@ public class IssueUpdaterTest {
 
     underTest.saveIssueAndPreloadSearchResponseData(db.getSession(), issue, context, false);
 
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
   }
 
   @Test
index 4c533efec84c473511f22366b644274033364dee..6a645b491dfd4788261e3d0f06408d8a447484bf 100644 (file)
@@ -38,7 +38,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;
 import static org.sonar.test.JsonAssert.assertJson;
 
@@ -64,7 +64,7 @@ public class IndexActionTest {
 
     TestResponse result = call(null, DateUtils.formatDateTime(aBitLater));
 
-    verifyZeroInteractions(i18n);
+    verifyNoInteractions(i18n);
     verify(server).getStartedAt();
     assertThat(result.getStatus()).isEqualTo(HttpURLConnection.HTTP_NOT_MODIFIED);
   }
index 256f49b0875ef36f1566862ce105716d3050c7f0..f287b02a097828a35bd6c557d6135521872da68f 100644 (file)
@@ -57,7 +57,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.test.JsonAssert.assertJson;
 
@@ -284,7 +284,7 @@ public class InstalledActionTest {
 
     String response = tester.newRequest().execute().getInput();
 
-    verifyZeroInteractions(updateCenterMatrixFactory);
+    verifyNoInteractions(updateCenterMatrixFactory);
     assertJson(response).isSimilarTo(
       "{" +
         "  \"plugins\":" +
@@ -445,7 +445,7 @@ public class InstalledActionTest {
 
     String response = tester.newRequest().execute().getInput();
 
-    verifyZeroInteractions(updateCenterMatrixFactory);
+    verifyNoInteractions(updateCenterMatrixFactory);
     assertJson(response)
       .isSimilarTo("{" +
         "  \"plugins\":" +
index 7422ae3ca1537ea13ee1e44ea1148db997cfbb34..400baaf738eed5007c66137a904e8c6c76b13797 100644 (file)
@@ -38,7 +38,7 @@ import static org.mockito.ArgumentMatchers.argThat;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 
 public class QProfileCopierTest {
 
@@ -90,7 +90,7 @@ public class QProfileCopierTest {
       fail();
     } catch (IllegalArgumentException e) {
       assertThat(e).hasMessage("Source and target profiles are equal: " + source.getName());
-      verifyZeroInteractions(backuper);
+      verifyNoInteractions(backuper);
     }
   }
 
index a9137a756ed8ea82c29f73216aafa0a7cfa60327..c185e40e7f909bc9e1ebd92640eaa48f94235450 100644 (file)
@@ -57,7 +57,7 @@ import static org.mockito.ArgumentMatchers.anyCollection;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 
 public class QProfileFactoryImplTest {
 
@@ -207,7 +207,7 @@ public class QProfileFactoryImplTest {
 
     underTest.delete(dbSession, Collections.emptyList());
 
-    verifyZeroInteractions(activeRuleIndexer);
+    verifyNoInteractions(activeRuleIndexer);
     assertQualityProfileFromDb(profile).isNotNull();
   }
 
index 7beb4f45b5de349c4826624dd054649b2dd08fb3..f5153a0d973515fd2d42c8b99ef028e22320579f 100644 (file)
@@ -74,7 +74,6 @@ import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
 import static org.mockito.Mockito.when;
 import static org.sonar.api.rules.RulePriority.MAJOR;
 import static org.sonar.db.qualityprofile.QualityProfileTesting.newRuleProfileDto;
@@ -119,7 +118,7 @@ public class RegisterQualityProfilesNotificationTest {
 
     underTest.start();
 
-    verifyZeroInteractions(builtInQualityProfilesNotification);
+    verifyNoInteractions(builtInQualityProfilesNotification);
   }
 
   @Test
index 3669e86518d5ea2bf05e4206bf30c56ee729510c..acc10ee9550e0845b642bd3c4923cbe89e58e334 100644 (file)
@@ -36,8 +36,8 @@ import static java.util.stream.Collectors.toSet;
 import static org.assertj.core.api.Assertions.assertThat;
 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 BuiltInQPChangeNotificationHandlerTest {
@@ -76,8 +76,8 @@ public class BuiltInQPChangeNotificationHandlerTest {
     assertThat(deliver).isZero();
     verify(emailNotificationChannel).isActivated();
     verifyNoMoreInteractions(emailNotificationChannel);
-    verifyZeroInteractions(dbClient);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    verifyNoInteractions(dbClient);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
   @Test
@@ -99,7 +99,7 @@ public class BuiltInQPChangeNotificationHandlerTest {
     verifyNoMoreInteractions(dbClient);
     verify(authorizationDao).selectQualityProfileAdministratorLogins(dbSession);
     verifyNoMoreInteractions(authorizationDao);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
   @Test
@@ -130,7 +130,7 @@ public class BuiltInQPChangeNotificationHandlerTest {
     verifyNoMoreInteractions(dbClient);
     verify(authorizationDao).selectQualityProfileAdministratorLogins(dbSession);
     verifyNoMoreInteractions(authorizationDao);
-    notifications.forEach(Mockito::verifyZeroInteractions);
+    notifications.forEach(Mockito::verifyNoInteractions);
   }
 
 }
index 74c555540021b1dc2c4e5fcee1919a1707160518..aac2248e2666e19de2dfee175ef45e53264853e9 100644 (file)
@@ -41,8 +41,8 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.tuple;
 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.sonar.core.config.CorePropertyDefinitions.DISABLE_NOTIFICATION_ON_BUILT_IN_QPROFILES;
 import static org.sonar.server.language.LanguageTesting.newLanguage;
 import static org.sonar.server.qualityprofile.ActiveRuleChange.Type.ACTIVATED;
@@ -157,7 +157,7 @@ public class BuiltInQualityProfilesUpdateListenerTest {
     BuiltInQualityProfilesUpdateListener underTest = new BuiltInQualityProfilesUpdateListener(notificationManager, languages, settings.asConfig());
     underTest.onChange(profiles, 0, 1);
 
-    verifyZeroInteractions(notificationManager);
+    verifyNoInteractions(notificationManager);
   }
 
   private Tuple addProfile(Multimap<QProfileName, ActiveRuleChange> profiles, Languages languages, ActiveRuleChange.Type type) {
index 2af81da0f0cca7fe50a71ad636dd5f62a2560f81..0d5a9e9df5d0da72be77b14c9d7fb35cd6467f69 100644 (file)
@@ -28,7 +28,7 @@ import javax.servlet.ServletContext;
 
 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;
 
 public class NullJarScannerTest {
   @Test
@@ -39,7 +39,7 @@ public class NullJarScannerTest {
     NullJarScanner scanner = new NullJarScanner();
 
     scanner.scan(JarScanType.PLUGGABILITY, context, callback);
-    verifyZeroInteractions(context, callback);
+    verifyNoInteractions(context, callback);
     scanner.setJarScanFilter(mock(JarScanFilter.class));
     assertThat(scanner.getJarScanFilter()).isNull();
   }
index 90fec94330ee153731f80ddb9ca696113fd11049..9ccf82998f9d24e66116e67ad399889026fa743a 100644 (file)
@@ -36,7 +36,7 @@ import org.sonar.process.Props;
 import static org.mockito.Mockito.any;
 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.sonar.process.ProcessProperties.Property.PATH_LOGS;
 
 public class TomcatAccessLogTest {
@@ -69,7 +69,7 @@ public class TomcatAccessLogTest {
 
     LifecycleEvent event = new LifecycleEvent(mock(Lifecycle.class), "before_init", null);
     listener.lifecycleEvent(event);
-    verifyZeroInteractions(logger);
+    verifyNoInteractions(logger);
 
     event = new LifecycleEvent(mock(Lifecycle.class), "after_start", null);
     listener.lifecycleEvent(event);
index 074605694923ce996a53570c81102e5e83dbeb51..431886dbbb5c2e30f5fa608b83b71b5b979ac99f 100644 (file)
@@ -27,7 +27,7 @@ import org.junit.Test;
 import static java.lang.String.format;
 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 CacheControlFilterTest {
@@ -88,7 +88,7 @@ public class CacheControlFilterTest {
 
     underTest.doFilter(request, response, chain);
 
-    verifyZeroInteractions(response);
+    verifyNoInteractions(response);
   }
 
   @Test
@@ -97,7 +97,7 @@ public class CacheControlFilterTest {
 
     underTest.doFilter(request, response, chain);
 
-    verifyZeroInteractions(response);
+    verifyNoInteractions(response);
   }
 
   private static HttpServletRequest newRequest(String path) {
index e7c8afbe5586a74f5fa7a2cf6d98741030eb2e0d..25d0eb807d3f2129faebd385cb3a52b22fab9bf6 100644 (file)
@@ -32,7 +32,7 @@ import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.reset;
 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 RedirectFilterTest {
@@ -66,7 +66,7 @@ public class RedirectFilterTest {
     underTest.doFilter(request, response, chain);
 
     verify(response).sendRedirect(expectedRedirection);
-    verifyZeroInteractions(chain);
+    verifyNoInteractions(chain);
     reset(response, chain);
   }
 
@@ -78,7 +78,7 @@ public class RedirectFilterTest {
     underTest.doFilter(request, response, chain);
 
     verify(chain).doFilter(request, response);
-    verifyZeroInteractions(response);
+    verifyNoInteractions(response);
     reset(response, chain);
   }
 }
index 727cd75483d484442626eda0fb4bb4edf43dd983..6e1504d5c3793a0d05aec482bf237110ef6a20ea 100644 (file)
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.RETURNS_MOCKS;
 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 WebPagesFilterTest {
@@ -78,7 +78,7 @@ public class WebPagesFilterTest {
     underTest.doFilter(request, response, chain);
 
     verify(chain).doFilter(request, response);
-    verifyZeroInteractions(webPagesCache);
+    verifyNoInteractions(webPagesCache);
   }
 
   static class StringOutputStream extends ServletOutputStream {
index a8700012609af6c9cdecd2bb1a1d7abc2b2559e4..e58ac066c36ccd9bb05471f09f1f9a8caebb0b4f 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.core.i18n;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
index 5dd300521815b8a3c46089b25d279653db16bcef..94d741b004b423c17ab4d4a00f5a1838093a4793 100644 (file)
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 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;
 
 public class ComponentKeysTest {
 
@@ -51,7 +51,7 @@ public class ComponentKeysTest {
   public void should_log_warning_if_toString_is_not_overridden() {
     Logger log = mock(Logger.class);
     keys.of(new Object(), log);
-    verifyZeroInteractions(log);
+    verifyNoInteractions(log);
 
     // only on non-first runs, to avoid false-positives on singletons
     keys.of(new Object(), log);
index 51f3b2158d1374d77e56d80254383e775d8cdc76..e1dddd28b79508715452ef60dd80bcd9289b9927 100644 (file)
@@ -47,6 +47,7 @@ import org.junit.rules.Timeout;
 import org.simpleframework.http.Request;
 import org.simpleframework.http.Response;
 import org.simpleframework.http.core.Container;
+import org.simpleframework.http.core.ContainerServer;
 import org.simpleframework.transport.connect.SocketConnection;
 import org.sonar.api.CoreProperties;
 import org.sonar.api.config.internal.MapSettings;
@@ -75,12 +76,12 @@ public class DefaultHttpDownloaderTest {
 
   @BeforeClass
   public static void startServer() throws IOException {
-    socketConnection = new SocketConnection(new Container() {
+    socketConnection = new SocketConnection(new ContainerServer(new Container() {
       public void handle(Request req, Response resp) {
         try {
           if (req.getPath().getPath().contains("/redirect/")) {
             resp.setCode(303);
-            resp.add("Location", "/");
+            resp.setValue("Location", "/");
           } else {
             if (req.getPath().getPath().contains("/timeout/")) {
               try {
@@ -93,7 +94,7 @@ public class DefaultHttpDownloaderTest {
               if (!"gzip".equals(req.getValue("Accept-Encoding"))) {
                 throw new IllegalStateException("Should accept gzip");
               }
-              resp.set("Content-Encoding", "gzip");
+              resp.setValue("Content-Encoding", "gzip");
               GZIPOutputStream gzipOutputStream = new GZIPOutputStream(resp.getOutputStream());
               gzipOutputStream.write("GZIP response".getBytes());
               gzipOutputStream.close();
@@ -110,7 +111,7 @@ public class DefaultHttpDownloaderTest {
           }
         }
       }
-    });
+    }));
     SocketAddress address = socketConnection.connect(new InetSocketAddress("localhost", 0));
 
     baseUrl = String.format("http://%s:%d", ((InetSocketAddress) address).getAddress().getHostAddress(), ((InetSocketAddress) address).getPort());
index a8c1fa521f4949f4a990fd06704dc00b497c3055..8f8c51c12c509bd0ba938dc711bffa9f1f96eab5 100644 (file)
@@ -24,7 +24,7 @@ import org.sonar.channel.CodeReader;
 
 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;
 
 public class BlackHoleTokenChannelTest {
 
@@ -37,7 +37,7 @@ public class BlackHoleTokenChannelTest {
     assertThat(channel.consume(codeReader, output)).isTrue();
     assertThat(codeReader.getLinePosition()).isOne();
     assertThat(codeReader.getColumnPosition()).isEqualTo(3);
-    verifyZeroInteractions(output);
+    verifyNoInteractions(output);
   }
 
 }
index cccabc53a9033bd363b127da0fed14abcac85e18..35a12b953a57f375f42e29977ef9e1c68fa7b132 100644 (file)
@@ -23,8 +23,8 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 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 org.junit.Test;
 import org.mockito.ArgumentCaptor;
@@ -69,7 +69,7 @@ public class TokenChannelTest {
     CodeReader codeReader = new CodeReader("123");
 
     assertThat(channel.consume(new CodeReader("123"), output), is(false));
-    verifyZeroInteractions(output);
+    verifyNoInteractions(output);
     assertThat(codeReader.getLinePosition(), is(1));
     assertThat(codeReader.getColumnPosition(), is(0));
   }
index 059d42394881e353b095424f4c1a5523df7f7ec4..770bc7eae8dc811f7996c745627593525f375506 100644 (file)
@@ -21,17 +21,16 @@ package org.sonar.api.batch.sensor.cpd.internal;
 
 import org.junit.Test;
 import org.sonar.api.batch.fs.InputFile;
-import org.sonar.api.batch.sensor.cpd.internal.DefaultCpdTokens;
-import org.sonar.api.batch.sensor.internal.SensorStorage;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
+import org.sonar.api.batch.sensor.internal.SensorStorage;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
 import static org.assertj.core.api.Assertions.tuple;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 
 public class DefaultCpdTokensTest {
   private final SensorStorage sensorStorage = mock(SensorStorage.class);
@@ -77,7 +76,7 @@ public class DefaultCpdTokensTest {
 
     tokens.save();
 
-    verifyZeroInteractions(sensorStorage);
+    verifyNoInteractions(sensorStorage);
 
     assertThat(tokens.getTokenLines()).isEmpty();
   }
@@ -97,7 +96,7 @@ public class DefaultCpdTokensTest {
       .addToken(testInputFile.newRange(1, 2, 1, 5), "foo");
 
     tokens.save();
-    verifyZeroInteractions(sensorStorage);
+    verifyNoInteractions(sensorStorage);
     assertThat(tokens.getTokenLines()).isEmpty();
   }
 
index d948da7f0c161445a636db51e71faf678a76bd45..0c4d98d490a11be0e8ec1ad12cb2bea3376f00e7 100644 (file)
@@ -30,7 +30,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.startsWith;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
 
 public class ConsoleLoggerTest {
 
@@ -66,7 +66,7 @@ public class ConsoleLoggerTest {
     underTest.debug("message {}", "foo");
     underTest.debug("message {} {}", "foo", "bar");
     underTest.debug("message {} {} {}", "foo", "bar", "baz");
-    verifyZeroInteractions(stream);
+    verifyNoInteractions(stream);
   }
 
   @Test
@@ -89,7 +89,7 @@ public class ConsoleLoggerTest {
     underTest.trace("message {}", "foo");
     underTest.trace("message {} {}", "foo", "bar");
     underTest.trace("message {} {} {}", "foo", "bar", "baz");
-    verifyZeroInteractions(stream);
+    verifyNoInteractions(stream);
   }
 
   @Test
index d23e829b11bfc6abf0eca8eabf3d61603c7ab00c..2464b134585076a9450a83ec2df333797af46824 100644 (file)
@@ -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
index 1cf46979e806beee8a7a191570f8df918a4a43cd..5e63367f913334a59e36ed75a37decb704bdceb3 100644 (file)
@@ -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
index c6c7ab05fd56fcd924fadfed7388e1728c30e361..2b3658f3157680875c50883deaa434964999f945 100644 (file)
@@ -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);
   }
 
index 1b0841f68d81dabf767b43e2e7f8c403245a548d..54561735cee99f27d00c39578296bf8806ec4ea5 100644 (file)
@@ -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
index e8383c54f73a74069b97ad42fa58b4a1ca1e133d..0c6e5d2c2ccf3a22f0be029e59f30c8ba8995201 100644 (file)
@@ -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();
   }
 
index d8c1576c289d967bae78ecd7dd994f7b21781836..ec319e1c931db03549bf47dd04e08943ef315a02 100644 (file)
@@ -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
index 6cbde59679dbe5cde33ab808d8bf35a025fdc7c4..bb5d8f78beae2170c8fd1f7e28b2b65d439f951c 100644 (file)
@@ -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
index be64c480015348228f9fa108123a59c4f39f2795..6ceb80baf7ff8fa17f2854cc5d3b76a4d4a2f152 100644 (file)
@@ -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 {