Browse Source

fix incomplete assertions

tags/5.2-RC1
Sébastien Lesaint 9 years ago
parent
commit
e15532991b

+ 1
- 1
server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java View File

@@ -119,7 +119,7 @@ public class MonitorTest {
failed = e.getMessage().equals("Can not start multiple times");
}
monitor.stop();
assertThat(failed);
assertThat(failed).isTrue();
}

@Test

+ 1
- 1
server/sonar-server/src/test/java/org/sonar/server/db/BaseDaoTest.java View File

@@ -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;


+ 1
- 1
server/sonar-server/src/test/java/org/sonar/server/es/EsUtilsTest.java View File

@@ -65,7 +65,7 @@ public class EsUtilsTest {

@Test
public void util_class() {
assertThat(TestUtils.hasOnlyPrivateConstructors(EsUtils.class));
assertThat(TestUtils.hasOnlyPrivateConstructors(EsUtils.class)).isTrue();
}

@Test

+ 1
- 1
server/sonar-server/src/test/java/org/sonar/server/rule/CommonRuleKeysTest.java View File

@@ -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();

}
}

+ 1
- 1
server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesMediumTest.java View File

@@ -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

+ 1
- 1
server/sonar-server/src/test/java/org/sonar/server/search/FacetsMediumTest.java View File

@@ -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);
}


+ 1
- 1
sonar-core/src/test/java/org/sonar/core/util/ProtobufTest.java View File

@@ -41,7 +41,7 @@ public class ProtobufTest {

@Test
public void only_utils() {
assertThat(TestUtils.hasOnlyPrivateConstructors(Protobuf.class));
assertThat(TestUtils.hasOnlyPrivateConstructors(Protobuf.class)).isTrue();
}

@Test

+ 2
- 2
sonar-db/src/test/java/org/sonar/db/purge/period/KeepOneFilterTest.java View File

@@ -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

+ 1
- 1
sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java View File

@@ -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);

Loading…
Cancel
Save