aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-main
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2021-11-18 16:45:02 -0600
committersonartech <sonartech@sonarsource.com>2021-11-20 20:03:51 +0000
commit3f9445c25962f914ccdd889c002ddd8e19b0cf89 (patch)
treeeb4f34a62b7164a71fd0bbe34d6f59621a687d8d /server/sonar-main
parentaa640be9e2b9cfa2c027ef0768940b31ebb5536c (diff)
downloadsonarqube-3f9445c25962f914ccdd889c002ddd8e19b0cf89.tar.gz
sonarqube-3f9445c25962f914ccdd889c002ddd8e19b0cf89.zip
Improve code quality
Diffstat (limited to 'server/sonar-main')
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/AppLoggingTest.java2
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/cluster/ClusterProcessTest.java2
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/command/JavaCommandTest.java6
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/es/EsLoggingTest.java2
4 files changed, 6 insertions, 6 deletions
diff --git a/server/sonar-main/src/test/java/org/sonar/application/AppLoggingTest.java b/server/sonar-main/src/test/java/org/sonar/application/AppLoggingTest.java
index 1e153ea4be0..bdfdf94ec60 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/AppLoggingTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/AppLoggingTest.java
@@ -250,7 +250,7 @@ public class AppLoggingTest {
underTest.configure();
assertThat(
- LoggerFactory.getLogger("com.hazelcast").isInfoEnabled()).isEqualTo(false);
+ LoggerFactory.getLogger("com.hazelcast").isInfoEnabled()).isFalse();
}
@Test
diff --git a/server/sonar-main/src/test/java/org/sonar/application/cluster/ClusterProcessTest.java b/server/sonar-main/src/test/java/org/sonar/application/cluster/ClusterProcessTest.java
index 38d5a862161..46c79c40a37 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/cluster/ClusterProcessTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/cluster/ClusterProcessTest.java
@@ -32,7 +32,7 @@ public class ClusterProcessTest {
ClusterProcess clusterProcess = new ClusterProcess(nodeUuid, ProcessId.WEB_SERVER);
assertThat(clusterProcess)
- .isNotEqualTo(null)
+ .isNotNull()
.isEqualTo(clusterProcess)
.isNotEqualTo(new ClusterProcess(UUID.randomUUID(), ProcessId.WEB_SERVER))
.isNotEqualTo(new ClusterProcess(nodeUuid, ProcessId.ELASTICSEARCH))
diff --git a/server/sonar-main/src/test/java/org/sonar/application/command/JavaCommandTest.java b/server/sonar-main/src/test/java/org/sonar/application/command/JavaCommandTest.java
index 8be42c22a96..777610474ff 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/command/JavaCommandTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/command/JavaCommandTest.java
@@ -47,7 +47,7 @@ public class JavaCommandTest {
command.setEnvVariable("JAVA_COMMAND_TEST", "1000");
command.addClasspath("lib/*.jar");
command.addClasspath("conf/*.xml");
- JvmOptions<JvmOptions> jvmOptions = new JvmOptions<JvmOptions>() {};
+ JvmOptions<JvmOptions> jvmOptions = new JvmOptions<>() {};
command.setJvmOptions(jvmOptions);
assertThat(command.toString()).isNotNull();
@@ -57,8 +57,8 @@ public class JavaCommandTest {
assertThat(command.getClassName()).isEqualTo("org.sonar.ElasticSearch");
// copy current env variables
- assertThat(command.getEnvVariables().get("JAVA_COMMAND_TEST")).isEqualTo("1000");
- assertThat(command.getEnvVariables().size()).isEqualTo(System.getenv().size() + 1);
+ assertThat(command.getEnvVariables()).containsEntry("JAVA_COMMAND_TEST", "1000");
+ assertThat(command.getEnvVariables()).hasSize(System.getenv().size() + 1);
}
}
diff --git a/server/sonar-main/src/test/java/org/sonar/application/es/EsLoggingTest.java b/server/sonar-main/src/test/java/org/sonar/application/es/EsLoggingTest.java
index 7c4380e2468..faa2a5752b9 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/es/EsLoggingTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/es/EsLoggingTest.java
@@ -146,7 +146,7 @@ public class EsLoggingTest {
assertThat(properties.get(key)).describedAs("Unexpected value for property " + key).isEqualTo(value);
keys.add(key);
}
- assertThat(properties.keySet()).containsOnly(keys.toArray());
+ assertThat(properties).containsOnlyKeys(keys.toArray());
}
}
}