]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-23649 Fix SonarQube issues
authorLéo Geoffroy <leo.geoffroy@sonarsource.com>
Mon, 25 Nov 2024 10:51:01 +0000 (11:51 +0100)
committersonartech <sonartech@sonarsource.com>
Tue, 26 Nov 2024 20:02:51 +0000 (20:02 +0000)
server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewModesNotificationsSenderTest.java

index 13306e2fd4a232812eae9b27ab9cbbd8eab5e050..233283c58e6c77dcbaeb7bab0e3bef472d97a651 100644 (file)
@@ -91,8 +91,10 @@ class NewModesNotificationsSenderTest {
     verify(notificationManager, times(2)).scheduleForSending(captor.capture());
 
     assertThat(captor.getAllValues())
-      .filteredOn(notification -> notification instanceof QualityGateMetricsUpdateNotification)
-      .map(notification -> (QualityGateMetricsUpdateNotification) notification)
+      .filteredOn(
+        QualityGateMetricsUpdateNotification.class::isInstance)
+      .map(
+        QualityGateMetricsUpdateNotification.class::cast)
       .hasSize(1)
       .extracting(QualityGateMetricsUpdateNotification::isMQRModeEnabled).isEqualTo(List.of(false));
   }
@@ -109,8 +111,9 @@ class NewModesNotificationsSenderTest {
     verify(notificationManager, times(1)).scheduleForSending(captor.capture());
 
     assertThat(captor.getAllValues())
-      .filteredOn(notification -> notification instanceof QualityGateMetricsUpdateNotification)
-      .map(notification -> (QualityGateMetricsUpdateNotification) notification)
+      .filteredOn(
+        QualityGateMetricsUpdateNotification.class::isInstance)
+      .map(QualityGateMetricsUpdateNotification.class::cast)
       .isEmpty();
   }
 }