aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-core
diff options
context:
space:
mode:
authorPierre <pierre.guillot@sonarsource.com>2020-12-11 17:20:41 +0100
committersonartech <sonartech@sonarsource.com>2020-12-14 20:07:14 +0000
commitffcea568c79640227b2fd9c562f642b9d087ea10 (patch)
tree6b0c16201bdc6308048744fea48f4e4a9667fd5d /server/sonar-webserver-core
parent4e07979ccca556d5f05a1be05b88f0bd85ff3f66 (diff)
downloadsonarqube-ffcea568c79640227b2fd9c562f642b9d087ea10.tar.gz
sonarqube-ffcea568c79640227b2fd9c562f642b9d087ea10.zip
fix code smells
Diffstat (limited to 'server/sonar-webserver-core')
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/ce/http/CeHttpClientImplTest.java2
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationMediumTest.java2
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java12
3 files changed, 8 insertions, 8 deletions
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/ce/http/CeHttpClientImplTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/ce/http/CeHttpClientImplTest.java
index bbd1e5f9b40..0b17ed1b096 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/ce/http/CeHttpClientImplTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/ce/http/CeHttpClientImplTest.java
@@ -77,7 +77,7 @@ public class CeHttpClientImplTest {
setUpWithHttpUrl(ProcessId.COMPUTE_ENGINE);
Optional<ProtobufSystemInfo.SystemInfo> info = underTest.retrieveSystemInfo();
- assertThat(info.get().getSectionsCount()).isEqualTo(0);
+ assertThat(info.get().getSectionsCount()).isZero();
}
@Test
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationMediumTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationMediumTest.java
index 39a67cee288..744d312b44a 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationMediumTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationMediumTest.java
@@ -208,7 +208,7 @@ public class NotificationMediumTest {
Settings settings = new MapSettings().setProperty("sonar.notifications.delay", 1L);
service = new NotificationService(dbClient);
- assertThat(service.getDispatchers()).hasSize(0);
+ assertThat(service.getDispatchers()).isEmpty();
}
@Test
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java
index 0227e4908f3..d1cad4df23f 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/RegisterRulesTest.java
@@ -452,7 +452,7 @@ public class RegisterRulesTest {
assertThat(rule1.getDescription()).isEqualTo("Description");
assertThat(ruleIndex.search(new RuleQuery().setQueryText("Name2"), new SearchOptions()).getTotal()).isEqualTo(1);
- assertThat(ruleIndex.search(new RuleQuery().setQueryText("Name1"), new SearchOptions()).getTotal()).isEqualTo(0);
+ assertThat(ruleIndex.search(new RuleQuery().setQueryText("Name1"), new SearchOptions()).getTotal()).isZero();
}
@Test
@@ -533,7 +533,7 @@ public class RegisterRulesTest {
SearchIdResult<String> searchRule2 = ruleIndex.search(new RuleQuery().setQueryText("Name2"), new SearchOptions());
assertThat(searchRule2.getUuids()).containsOnly(rule2.getUuid());
assertThat(searchRule2.getTotal()).isEqualTo(1);
- assertThat(ruleIndex.search(new RuleQuery().setQueryText("Name1"), new SearchOptions()).getTotal()).isEqualTo(0);
+ assertThat(ruleIndex.search(new RuleQuery().setQueryText("Name1"), new SearchOptions()).getTotal()).isZero();
}
@Test
@@ -575,7 +575,7 @@ public class RegisterRulesTest {
SearchIdResult<String> searchRule2 = ruleIndex.search(new RuleQuery().setQueryText("Name2"), new SearchOptions());
assertThat(searchRule2.getUuids()).containsOnly(rule2.getUuid());
assertThat(searchRule2.getTotal()).isEqualTo(1);
- assertThat(ruleIndex.search(new RuleQuery().setQueryText("Name1"), new SearchOptions()).getTotal()).isEqualTo(0);
+ assertThat(ruleIndex.search(new RuleQuery().setQueryText("Name1"), new SearchOptions()).getTotal()).isZero();
}
@Test
@@ -691,7 +691,7 @@ public class RegisterRulesTest {
assertThat(rule1.getDescription()).isEqualTo("Desc2");
assertThat(ruleIndex.search(new RuleQuery().setQueryText("Desc2"), new SearchOptions()).getTotal()).isEqualTo(1);
- assertThat(ruleIndex.search(new RuleQuery().setQueryText("Desc1"), new SearchOptions()).getTotal()).isEqualTo(0);
+ assertThat(ruleIndex.search(new RuleQuery().setQueryText("Desc1"), new SearchOptions()).getTotal()).isZero();
}
@Test
@@ -748,7 +748,7 @@ public class RegisterRulesTest {
RuleDto rule = dbClient.ruleDao().selectOrFailByKey(db.getSession(), RULE_KEY1);
assertThat(rule.getStatus()).isEqualTo(REMOVED);
- assertThat(ruleIndex.search(new RuleQuery().setKey(RULE_KEY1.toString()), new SearchOptions()).getTotal()).isEqualTo(0);
+ assertThat(ruleIndex.search(new RuleQuery().setKey(RULE_KEY1.toString()), new SearchOptions()).getTotal()).isZero();
// Re-install rule
system.setNow(DATE3.getTime());
@@ -899,7 +899,7 @@ public class RegisterRulesTest {
assertThat(dbClient.ruleDao().selectAllDefinitions(db.getSession())).hasSize(1);
deprecatedRuleKeys = dbClient.ruleDao().selectAllDeprecatedRuleKeys(db.getSession());
- assertThat(deprecatedRuleKeys).hasSize(0);
+ assertThat(deprecatedRuleKeys).isEmpty();
}
@Test