summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-08-18 12:55:06 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-08-18 12:55:24 +0200
commite15532991b8ab189d27563abb1c7c36b91f6dcae (patch)
tree521e9260023afd17b5cfd70985dfd2300c27a89c
parent332c8e3a4011c3d9ef3e0d12106482f0f80f8bf0 (diff)
downloadsonarqube-e15532991b8ab189d27563abb1c7c36b91f6dcae.tar.gz
sonarqube-e15532991b8ab189d27563abb1c7c36b91f6dcae.zip
fix incomplete assertions
-rw-r--r--server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/es/EsUtilsTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/rule/CommonRuleKeysTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/util/ProtobufTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/purge/period/KeepOneFilterTest.java4
-rw-r--r--sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java2
9 files changed, 10 insertions, 10 deletions
diff --git a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java
index a144d7aad1d..9475145c97b 100644
--- a/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java
+++ b/server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java
@@ -119,7 +119,7 @@ public class MonitorTest {
failed = e.getMessage().equals("Can not start multiple times");
}
monitor.stop();
- assertThat(failed);
+ assertThat(failed).isTrue();
}
@Test
diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java
index 45d672bc79d..f8b67dfdbdc 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java
@@ -84,7 +84,7 @@ public class BaseDaoTest {
dao.insert(session, myDto);
session.commit();
- assertThat(myDto.getId());
+ assertThat(myDto.getId()).isGreaterThan(0);
long t1 = System.currentTimeMillis() + 1000;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/es/EsUtilsTest.java b/server/sonar-server/src/test/java/org/sonar/server/es/EsUtilsTest.java
index 1a8148b8cb6..73bb4d53757 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/es/EsUtilsTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/es/EsUtilsTest.java
@@ -65,7 +65,7 @@ public class EsUtilsTest {
@Test
public void util_class() {
- assertThat(TestUtils.hasOnlyPrivateConstructors(EsUtils.class));
+ assertThat(TestUtils.hasOnlyPrivateConstructors(EsUtils.class)).isTrue();
}
@Test
diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/CommonRuleKeysTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/CommonRuleKeysTest.java
index 974fbfd4750..73d6eb3b609 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/rule/CommonRuleKeysTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/rule/CommonRuleKeysTest.java
@@ -33,7 +33,7 @@ public class CommonRuleKeysTest {
@Test
public void wonderful_test_to_verify_that_this_class_is_an_helper_class() throws Exception {
- assertThat(TestUtils.hasOnlyPrivateConstructors(CommonRuleKeys.class));
+ assertThat(TestUtils.hasOnlyPrivateConstructors(CommonRuleKeys.class)).isTrue();
}
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java
index 0aec87f3c59..9d89d21b3db 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java
@@ -321,7 +321,7 @@ public class RegisterRulesMediumTest {
// Verify rule has not been updated
Rule customRuleReloaded = ruleIndex.getByKey(RuleTesting.XOO_X1);
- assertThat(DateUtils.isSameInstant(customRuleReloaded.updatedAt(), updatedAt));
+ assertThat(DateUtils.isSameInstant(customRuleReloaded.updatedAt(), updatedAt)).isTrue();
}
@Test
diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java
index 80eb1bb18eb..fbeeaf5dbbf 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java
@@ -145,7 +145,7 @@ public class FacetsMediumTest {
assertThat(facets.getFacetKeys(FIELD_TAGS)).isEmpty();
assertThat(facets.getFacetKeys(FIELD_CREATED_AT)).hasSize(1);
FacetValue value = facets.getFacetValues(FIELD_CREATED_AT).iterator().next();
- assertThat(DateUtils.parseDateTime(value.getKey()).before(new Date()));
+ assertThat(DateUtils.parseDateTime(value.getKey()).before(new Date())).isTrue();
assertThat(value.getValue()).isEqualTo(3L);
}
diff --git a/sonar-core/src/test/java/org/sonar/core/util/ProtobufTest.java b/sonar-core/src/test/java/org/sonar/core/util/ProtobufTest.java
index 493da413789..290cfb13611 100644
--- a/sonar-core/src/test/java/org/sonar/core/util/ProtobufTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/util/ProtobufTest.java
@@ -41,7 +41,7 @@ public class ProtobufTest {
@Test
public void only_utils() {
- assertThat(TestUtils.hasOnlyPrivateConstructors(Protobuf.class));
+ assertThat(TestUtils.hasOnlyPrivateConstructors(Protobuf.class)).isTrue();
}
@Test
diff --git a/sonar-db/src/test/java/org/sonar/db/purge/period/KeepOneFilterTest.java b/sonar-db/src/test/java/org/sonar/db/purge/period/KeepOneFilterTest.java
index 94845f431ae..8a9191b9822 100644
--- a/sonar-db/src/test/java/org/sonar/db/purge/period/KeepOneFilterTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/purge/period/KeepOneFilterTest.java
@@ -62,7 +62,7 @@ public class KeepOneFilterTest {
List<Long> snapshotIds = snapshotIds(toDelete);
assertThat(snapshotIds).contains(3L);
- assertThat(snapshotIds.contains(4L));
+ assertThat(snapshotIds).contains(4L);
}
@Test
@@ -80,7 +80,7 @@ public class KeepOneFilterTest {
List<Long> snapshotIds = snapshotIds(toDelete);
assertThat(snapshotIds).contains(1L);
- assertThat(snapshotIds.contains(4L));
+ assertThat(snapshotIds).contains(4L);
}
@Test
diff --git a/sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java b/sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java
index de2d616147d..19b31f5b18c 100644
--- a/sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java
@@ -85,7 +85,7 @@ public class RuleDaoTest {
dbTester.prepareDbUnit(getClass(), "shared.xml");
assertThat(underTest.selectByKeys(dbTester.getSession(), Collections.<RuleKey>emptyList())).isEmpty();
- assertThat(underTest.selectByKeys(dbTester.getSession(), asList(RuleKey.of("NOT", "FOUND"))).isEmpty());
+ assertThat(underTest.selectByKeys(dbTester.getSession(), asList(RuleKey.of("NOT", "FOUND")))).isEmpty();
List<RuleDto> rules = underTest.selectByKeys(dbTester.getSession(), asList(RuleKey.of("java", "S001"), RuleKey.of("java", "OTHER")));
assertThat(rules).hasSize(1);