diff options
author | Pierre <pierre.guillot@sonarsource.com> | 2020-12-11 17:20:41 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-12-14 20:07:14 +0000 |
commit | ffcea568c79640227b2fd9c562f642b9d087ea10 (patch) | |
tree | 6b0c16201bdc6308048744fea48f4e4a9667fd5d /server/sonar-process/src/test | |
parent | 4e07979ccca556d5f05a1be05b88f0bd85ff3f66 (diff) | |
download | sonarqube-ffcea568c79640227b2fd9c562f642b9d087ea10.tar.gz sonarqube-ffcea568c79640227b2fd9c562f642b9d087ea10.zip |
fix code smells
Diffstat (limited to 'server/sonar-process/src/test')
4 files changed, 6 insertions, 6 deletions
diff --git a/server/sonar-process/src/test/java/org/sonar/process/FileUtils2Test.java b/server/sonar-process/src/test/java/org/sonar/process/FileUtils2Test.java index 1a70413b89b..dc4a362796b 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/FileUtils2Test.java +++ b/server/sonar-process/src/test/java/org/sonar/process/FileUtils2Test.java @@ -268,7 +268,7 @@ public class FileUtils2Test { public void sizeOf_is_zero_on_empty_files() throws IOException { File file = temporaryFolder.newFile(); - assertThat(FileUtils2.sizeOf(file.toPath())).isEqualTo(0); + assertThat(FileUtils2.sizeOf(file.toPath())).isZero(); } @Test diff --git a/server/sonar-process/src/test/java/org/sonar/process/logging/Log4JPropertiesBuilderTest.java b/server/sonar-process/src/test/java/org/sonar/process/logging/Log4JPropertiesBuilderTest.java index c944cb2e583..e98fdbfba6f 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/logging/Log4JPropertiesBuilderTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/logging/Log4JPropertiesBuilderTest.java @@ -482,7 +482,7 @@ public class Log4JPropertiesBuilderTest { private static Log4JPropertiesBuilder newLog4JPropertiesBuilder(String... propertyKeysAndValues) { Properties properties = new Properties(); - assertThat(propertyKeysAndValues.length % 2).describedAs("propertyKeysAndValues must have even length").isEqualTo(0); + assertThat(propertyKeysAndValues.length % 2).describedAs("propertyKeysAndValues must have even length").isZero(); for (int i = 0; i < propertyKeysAndValues.length; i++) { properties.put(propertyKeysAndValues[i++], propertyKeysAndValues[i]); } @@ -534,7 +534,7 @@ public class Log4JPropertiesBuilderTest { if (expectedPropertyKeysAndValuesOrdered.length == 0) { assertThat(properties.size()).isEqualTo(1); } else { - assertThat(expectedPropertyKeysAndValuesOrdered.length % 2).describedAs("Number of parameters must be even").isEqualTo(0); + assertThat(expectedPropertyKeysAndValuesOrdered.length % 2).describedAs("Number of parameters must be even").isZero(); Set<String> keys = new HashSet<>(expectedPropertyKeysAndValuesOrdered.length / 2 + 1); keys.add("status"); for (int i = 0; i < expectedPropertyKeysAndValuesOrdered.length; i++) { diff --git a/server/sonar-process/src/test/java/org/sonar/process/logging/LogLevelConfigTest.java b/server/sonar-process/src/test/java/org/sonar/process/logging/LogLevelConfigTest.java index a16c33ddeee..63d5d66b3ee 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/logging/LogLevelConfigTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/logging/LogLevelConfigTest.java @@ -70,7 +70,7 @@ public class LogLevelConfigTest { assertThat(underTest.getConfiguredByProperties()).hasSize(1); assertThat(underTest.getConfiguredByProperties().get(rootLoggerName)) .containsExactly("sonar.log.level", "sonar.log.level.es"); - assertThat(underTest.getConfiguredByHardcodedLevel()).hasSize(0); + assertThat(underTest.getConfiguredByHardcodedLevel()).isEmpty(); } @Test @@ -132,7 +132,7 @@ public class LogLevelConfigTest { assertThat(underTest.getConfiguredByProperties()).hasSize(1); assertThat(underTest.getConfiguredByProperties().get("foo")) .containsExactly("sonar.log.level", "sonar.log.level.web", "sonar.log.level.web.sql"); - assertThat(underTest.getConfiguredByHardcodedLevel()).hasSize(0); + assertThat(underTest.getConfiguredByHardcodedLevel()).isEmpty(); } @Test diff --git a/server/sonar-process/src/test/java/org/sonar/process/logging/LogbackHelperTest.java b/server/sonar-process/src/test/java/org/sonar/process/logging/LogbackHelperTest.java index 3fa05bebd51..ec66760a137 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/logging/LogbackHelperTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/logging/LogbackHelperTest.java @@ -165,7 +165,7 @@ public class LogbackHelperTest { julLogger.severe("Message1"); // JUL bridge has not been initialized, nothing in logs - assertThat(memoryAppender.getLogs()).hasSize(0); + assertThat(memoryAppender.getLogs()).isEmpty(); // Enabling JUL bridge LoggerContextListener propagator = underTest.enableJulChangePropagation(ctx); |