From 7394e85879c9ccd4eca67e7fccb80ad5523da82b Mon Sep 17 00:00:00 2001 From: Léo Geoffroy Date: Mon, 25 Nov 2024 11:51:01 +0100 Subject: SONAR-23649 Fix SonarQube issues --- .../issue/notification/NewModesNotificationsSenderTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewModesNotificationsSenderTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewModesNotificationsSenderTest.java index 13306e2fd4a..233283c58e6 100644 --- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewModesNotificationsSenderTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewModesNotificationsSenderTest.java @@ -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(); } } -- cgit v1.2.3