diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2023-01-12 09:35:20 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-01-12 20:02:51 +0000 |
commit | 118a3ed166799831e097748f2ce8e113298ad14e (patch) | |
tree | 9ea5410359990f4ef457bf0822b5b31a770d15de /server/sonar-webserver-core/src | |
parent | 0b5343ff7744ec27ed14a90e07833319719bc9a8 (diff) | |
download | sonarqube-118a3ed166799831e097748f2ce8e113298ad14e.tar.gz sonarqube-118a3ed166799831e097748f2ce8e113298ad14e.zip |
[NO JIRA] Fix quality issues related to assertions
Diffstat (limited to 'server/sonar-webserver-core/src')
3 files changed, 5 insertions, 5 deletions
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationChannelTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationChannelTest.java index 40b0a25d890..edd6354a881 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationChannelTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationChannelTest.java @@ -31,7 +31,7 @@ public class NotificationChannelTest { public void defaultMethods() { NotificationChannel channel = new FakeNotificationChannel(); assertThat(channel.getKey()).isEqualTo("FakeNotificationChannel"); - assertThat(channel.toString()).isEqualTo("FakeNotificationChannel"); + assertThat(channel).hasToString("FakeNotificationChannel"); } private static class FakeNotificationChannel extends NotificationChannel { diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/serverid/ServerIdFactoryImplTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/serverid/ServerIdFactoryImplTest.java index 897d6ebe5fc..11ec21846fd 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/serverid/ServerIdFactoryImplTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/serverid/ServerIdFactoryImplTest.java @@ -71,7 +71,7 @@ public class ServerIdFactoryImplTest { ServerId serverId = underTest.create(); - assertThat(serverId.getDatabaseId().get()).isEqualTo(crc32Hex(sanitizedJdbcUrl)); + assertThat(serverId.getDatabaseId()).contains(crc32Hex(sanitizedJdbcUrl)); assertThat(serverId.getDatasetId()).isEqualTo(uuid); } @@ -91,7 +91,7 @@ public class ServerIdFactoryImplTest { ServerId serverId = underTest.create(currentServerId); - assertThat(serverId.getDatabaseId().get()).isEqualTo(crc32Hex(sanitizedJdbcUrl)); + assertThat(serverId.getDatabaseId()).contains(crc32Hex(sanitizedJdbcUrl)); assertThat(serverId.getDatasetId()).isEqualTo(currentServerId.getDatasetId()); } diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryClientTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryClientTest.java index 765dc58d825..2beb1f54f47 100644 --- a/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryClientTest.java +++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/telemetry/TelemetryClientTest.java @@ -61,7 +61,7 @@ public class TelemetryClientTest { Buffer body = new Buffer(); request.body().writeTo(body); assertThat(body.readUtf8()).isEqualTo(JSON); - assertThat(request.url().toString()).isEqualTo(TELEMETRY_URL); + assertThat(request.url()).hasToString(TELEMETRY_URL); } @Test @@ -79,6 +79,6 @@ public class TelemetryClientTest { Buffer body = new Buffer(); request.body().writeTo(body); assertThat(body.readUtf8()).isEqualTo(JSON); - assertThat(request.url().toString()).isEqualTo(TELEMETRY_URL); + assertThat(request.url()).hasToString(TELEMETRY_URL); } } |