diff options
author | Julien Camus <julien.camus@sonarsource.com> | 2024-12-20 10:42:05 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-12-20 20:03:10 +0000 |
commit | afe11634f5a0c1d89a5c0ea41cd1cebf78593b75 (patch) | |
tree | b1ed646d3f26b435feb6936624c488bdf1b3e024 /server/sonar-server-common/src/test | |
parent | 77a3f39cc788ea88e28e72caee5d36cf72bc2c95 (diff) | |
download | sonarqube-afe11634f5a0c1d89a5c0ea41cd1cebf78593b75.tar.gz sonarqube-afe11634f5a0c1d89a5c0ea41cd1cebf78593b75.zip |
SONAR-24066 Replace deprecated LoggerLevel calls to SLF4J Level
Diffstat (limited to 'server/sonar-server-common/src/test')
-rw-r--r-- | server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java index 152c8459698..ca10b5d5aa3 100644 --- a/server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/notification/email/EmailNotificationChannelTest.java @@ -45,7 +45,6 @@ import org.slf4j.event.Level; import org.sonar.api.notifications.Notification; import org.sonar.api.platform.Server; import org.sonar.api.testfixtures.log.LogTester; -import org.sonar.api.utils.log.LoggerLevel; import org.sonar.server.email.EmailSmtpConfiguration; import org.sonar.server.issue.notification.EmailMessage; import org.sonar.server.issue.notification.EmailTemplate; @@ -72,7 +71,7 @@ public class EmailNotificationChannelTest { public LogTester logTester = new LogTester(); @Rule - public final GreenMailRule smtpServer = new GreenMailRule(new ServerSetup[]{ServerSetupTest.SMTP, ServerSetupTest.SMTPS}); + public final GreenMailRule smtpServer = new GreenMailRule(new ServerSetup[] {ServerSetupTest.SMTP, ServerSetupTest.SMTPS}); private EmailSmtpConfiguration configuration; private Server server; @@ -80,7 +79,7 @@ public class EmailNotificationChannelTest { @Before public void setUp() { - logTester.setLevel(LoggerLevel.DEBUG); + logTester.setLevel(Level.DEBUG); configuration = mock(EmailSmtpConfiguration.class); server = mock(Server.class); @@ -132,7 +131,7 @@ public class EmailNotificationChannelTest { @Test public void sendTestEmailShouldSanitizeLog() throws Exception { - logTester.setLevel(LoggerLevel.TRACE); + logTester.setLevel(Level.TRACE); configure(); underTest.sendTestEmail("user@nowhere", "Test Message from SonarQube", "This is a message \n containing line breaks \r that should be sanitized when logged."); @@ -315,7 +314,7 @@ public class EmailNotificationChannelTest { Set<EmailDeliveryRequest> requests = Stream.of(notification1, notification2, notification3) .map(t -> new EmailDeliveryRequest(recipientEmail, t)) .collect(toSet()); - EmailNotificationChannel emailNotificationChannel = new EmailNotificationChannel(configuration, server, new EmailTemplate[]{template1, template3}, null, + EmailNotificationChannel emailNotificationChannel = new EmailNotificationChannel(configuration, server, new EmailTemplate[] {template1, template3}, null, mock(OAuthMicrosoftRestClient.class)); int count = emailNotificationChannel.deliverAll(requests); @@ -349,7 +348,7 @@ public class EmailNotificationChannelTest { when(template11.format(notification1)).thenReturn(emailMessage11); when(template12.format(notification1)).thenReturn(emailMessage12); EmailDeliveryRequest request = new EmailDeliveryRequest(recipientEmail, notification1); - EmailNotificationChannel emailNotificationChannel = new EmailNotificationChannel(configuration, server, new EmailTemplate[]{template11, template12}, null, + EmailNotificationChannel emailNotificationChannel = new EmailNotificationChannel(configuration, server, new EmailTemplate[] {template11, template12}, null, mock(OAuthMicrosoftRestClient.class)); int count = emailNotificationChannel.deliverAll(Collections.singleton(request)); @@ -362,7 +361,7 @@ public class EmailNotificationChannelTest { @DataProvider public static Object[][] emptyStrings() { - return new Object[][]{ + return new Object[][] { {""}, {" "}, {" \n "} |