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-api | |
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-api')
-rw-r--r-- | server/sonar-webserver-api/src/test/java/org/sonar/server/exceptions/MessageTest.java | 6 | ||||
-rw-r--r-- | server/sonar-webserver-api/src/test/java/org/sonar/server/project/RekeyedProjectTest.java | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-webserver-api/src/test/java/org/sonar/server/exceptions/MessageTest.java b/server/sonar-webserver-api/src/test/java/org/sonar/server/exceptions/MessageTest.java index 27e10c8a18a..d7bbaf89e13 100644 --- a/server/sonar-webserver-api/src/test/java/org/sonar/server/exceptions/MessageTest.java +++ b/server/sonar-webserver-api/src/test/java/org/sonar/server/exceptions/MessageTest.java @@ -76,8 +76,8 @@ public class MessageTest { @Test public void to_string() { - assertThat(Message.of("key1 %s", "param1").toString()).isEqualTo("key1 param1"); - assertThat(Message.of("key1").toString()).isEqualTo("key1"); - assertThat(Message.of("key1", (Object[])null).toString()).isEqualTo("key1"); + assertThat(Message.of("key1 %s", "param1")).hasToString("key1 param1"); + assertThat(Message.of("key1")).hasToString("key1"); + assertThat(Message.of("key1", (Object[])null)).hasToString("key1"); } } diff --git a/server/sonar-webserver-api/src/test/java/org/sonar/server/project/RekeyedProjectTest.java b/server/sonar-webserver-api/src/test/java/org/sonar/server/project/RekeyedProjectTest.java index e175bed9b10..131545b0eb4 100644 --- a/server/sonar-webserver-api/src/test/java/org/sonar/server/project/RekeyedProjectTest.java +++ b/server/sonar-webserver-api/src/test/java/org/sonar/server/project/RekeyedProjectTest.java @@ -89,7 +89,7 @@ public class RekeyedProjectTest { String previousKey = "E"; RekeyedProject underTest = new RekeyedProject(project, previousKey); - assertThat(underTest.toString()).isEqualTo("RekeyedProject{project=Project{uuid='A', key='B', name='C', description='D'}, previousKey='E'}"); + assertThat(underTest).hasToString("RekeyedProject{project=Project{uuid='A', key='B', name='C', description='D'}, previousKey='E'}"); } private static Project newRandomProject() { |