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-db-dao/src | |
parent | 4e07979ccca556d5f05a1be05b88f0bd85ff3f66 (diff) | |
download | sonarqube-ffcea568c79640227b2fd9c562f642b9d087ea10.tar.gz sonarqube-ffcea568c79640227b2fd9c562f642b9d087ea10.zip |
fix code smells
Diffstat (limited to 'server/sonar-db-dao/src')
28 files changed, 82 insertions, 82 deletions
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java index c6d08a72d11..faf9cee5e27 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java @@ -129,7 +129,7 @@ public class CeActivityDaoTest { insertWarnings(tasks[2], 1); assertThat(underTest.selectByUuid(dbSession, tasks[0].getUuid()).get().getWarningCount()).isEqualTo(moreThan1); - assertThat(underTest.selectByUuid(dbSession, tasks[1].getUuid()).get().getWarningCount()).isEqualTo(0); + assertThat(underTest.selectByUuid(dbSession, tasks[1].getUuid()).get().getWarningCount()).isZero(); assertThat(underTest.selectByUuid(dbSession, tasks[2].getUuid()).get().getWarningCount()).isEqualTo(1); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java index 3af142c4223..c200245a044 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java @@ -246,7 +246,7 @@ public class CeQueueDaoTest { insertPending(TASK_UUID_2, MAIN_COMPONENT_UUID_1); int deletedCount = underTest.deleteByUuid(db.getSession(), "UNKNOWN"); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectByUuid(db.getSession(), TASK_UUID_1)).isPresent(); deletedCount = underTest.deleteByUuid(db.getSession(), TASK_UUID_1); @@ -264,15 +264,15 @@ public class CeQueueDaoTest { insertInProgress(TASK_UUID_2, MAIN_COMPONENT_UUID_1); int deletedCount = underTest.deleteByUuid(db.getSession(), "UNKNOWN", null); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectByUuid(db.getSession(), TASK_UUID_1)).isPresent(); deletedCount = underTest.deleteByUuid(db.getSession(), TASK_UUID_1, new DeleteIf(IN_PROGRESS)); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectByUuid(db.getSession(), TASK_UUID_1)).isPresent(); deletedCount = underTest.deleteByUuid(db.getSession(), TASK_UUID_2, new DeleteIf(PENDING)); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectByUuid(db.getSession(), TASK_UUID_2)).isPresent(); deletedCount = underTest.deleteByUuid(db.getSession(), TASK_UUID_1, new DeleteIf(PENDING)); @@ -519,7 +519,7 @@ public class CeQueueDaoTest { int total = underTest.countByQuery(db.getSession(), query); assertThat(result).isEmpty(); - assertThat(total).isEqualTo(0); + assertThat(total).isZero(); } @Test @@ -536,7 +536,7 @@ public class CeQueueDaoTest { int total = underTest.countByQuery(db.getSession(), query); assertThat(result).isEmpty(); - assertThat(total).isEqualTo(0); + assertThat(total).isZero(); } @Test @@ -553,7 +553,7 @@ public class CeQueueDaoTest { int total = underTest.countByQuery(db.getSession(), query); assertThat(result).isEmpty(); - assertThat(total).isEqualTo(0); + assertThat(total).isZero(); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskCharacteristicDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskCharacteristicDaoTest.java index 7dedd7a9d15..b466fd8bb0d 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskCharacteristicDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskCharacteristicDaoTest.java @@ -63,9 +63,9 @@ public class CeTaskCharacteristicDaoTest { insert("key3", "value3", "uuid3", "task3"); underTest.deleteByTaskUuids(dbTester.getSession(), ImmutableSet.of("task1", "task3")); - assertThat(underTest.selectByTaskUuids(dbTester.getSession(), singletonList("task1"))).hasSize(0); + assertThat(underTest.selectByTaskUuids(dbTester.getSession(), singletonList("task1"))).isEmpty(); assertThat(underTest.selectByTaskUuids(dbTester.getSession(), singletonList("task2"))).hasSize(1); - assertThat(underTest.selectByTaskUuids(dbTester.getSession(), singletonList("task3"))).hasSize(0); + assertThat(underTest.selectByTaskUuids(dbTester.getSession(), singletonList("task3"))).isEmpty(); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskInputDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskInputDaoTest.java index d11a6687a29..bc9c42c0fa9 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskInputDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeTaskInputDaoTest.java @@ -104,7 +104,7 @@ public class CeTaskInputDaoTest { underTest.deleteByUuids(dbTester.getSession(), singleton(A_UUID)); dbTester.commit(); - assertThat(dbTester.countRowsOfTable(TABLE_NAME)).isEqualTo(0); + assertThat(dbTester.countRowsOfTable(TABLE_NAME)).isZero(); } private void insertData(String uuid) { diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/BranchDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/BranchDaoTest.java index 42a5b7efb01..e521615ef5e 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/BranchDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/BranchDaoTest.java @@ -560,7 +560,7 @@ public class BranchDaoTest { @Test public void countByTypeAndCreationDate() { - assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.BRANCH, 0L)).isEqualTo(0); + assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.BRANCH, 0L)).isZero(); ComponentDto project = db.components().insertPrivateProject(); ComponentDto branch1 = db.components().insertProjectBranch(project, b -> b.setBranchType(BranchType.BRANCH)); @@ -568,10 +568,10 @@ public class BranchDaoTest { ComponentDto pr = db.components().insertProjectBranch(project, b -> b.setBranchType(BranchType.PULL_REQUEST)); assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.BRANCH, 0L)).isEqualTo(3); assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.BRANCH, NOW)).isEqualTo(3); - assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.BRANCH, NOW + 100)).isEqualTo(0); + assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.BRANCH, NOW + 100)).isZero(); assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.PULL_REQUEST, 0L)).isEqualTo(1); assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.PULL_REQUEST, NOW)).isEqualTo(1); - assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.PULL_REQUEST, NOW + 100)).isEqualTo(0); + assertThat(underTest.countByTypeAndCreationDate(dbSession, BranchType.PULL_REQUEST, NOW + 100)).isZero(); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ComponentDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ComponentDaoTest.java index 7f1c2e7b403..d7a05428468 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ComponentDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ComponentDaoTest.java @@ -1159,7 +1159,7 @@ public class ComponentDaoTest { Supplier<ComponentQuery.Builder> query = () -> ComponentQuery.builder().setOnProvisionedOnly(true); assertThat(underTest.countByQuery(dbSession, organization.getUuid(), query.get().setQualifiers(PROJECT).build())).isEqualTo(1); - assertThat(underTest.countByQuery(dbSession, organization.getUuid(), query.get().setQualifiers(Qualifiers.VIEW).build())).isEqualTo(0); + assertThat(underTest.countByQuery(dbSession, organization.getUuid(), query.get().setQualifiers(Qualifiers.VIEW).build())).isZero(); assertThat(underTest.countByQuery(dbSession, organization.getUuid(), query.get().setQualifiers(PROJECT, Qualifiers.VIEW).build())).isEqualTo(1); } @@ -1470,7 +1470,7 @@ public class ComponentDaoTest { assertThat(underTest.countByQuery(dbSession, organization2.getUuid(), ALL_PROJECTS_COMPONENT_QUERY)) .isEqualTo(1); assertThat(underTest.countByQuery(dbSession, "non existent organization uuid", ALL_PROJECTS_COMPONENT_QUERY)) - .isEqualTo(0); + .isZero(); } @Test @@ -1628,7 +1628,7 @@ public class ComponentDaoTest { int count = underTest.countByQuery(dbSession, dbQuery); assertThat(result).isEmpty(); - assertThat(count).isEqualTo(0); + assertThat(count).isZero(); } @Test @@ -1656,7 +1656,7 @@ public class ComponentDaoTest { int count = underTest.countByQuery(dbSession, dbQuery); assertThat(result).isEmpty(); - assertThat(count).isEqualTo(0); + assertThat(count).isZero(); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ProjectLinkDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ProjectLinkDaoTest.java index 6d62edf795d..2615c9e7756 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ProjectLinkDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ProjectLinkDaoTest.java @@ -160,7 +160,7 @@ public class ProjectLinkDaoTest { underTest.delete(db.getSession(), link.getUuid()); db.getSession().commit(); - assertThat(db.countRowsOfTable("project_links")).isEqualTo(0); + assertThat(db.countRowsOfTable("project_links")).isZero(); } } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java index e938671731d..e92978a03a2 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java @@ -139,9 +139,9 @@ public class DuplicationDaoTest { Assertions.assertThat(block.getComponentUuid()).isEqualTo(project3.uuid()); Assertions.assertThat(block.getHash()).isEqualTo("bb"); Assertions.assertThat(block.getAnalysisUuid()).isEqualTo(analysis3.getUuid()); - Assertions.assertThat(block.getIndexInFile()).isEqualTo(0); - Assertions.assertThat(block.getStartLine()).isEqualTo(0); - Assertions.assertThat(block.getEndLine()).isEqualTo(0); + Assertions.assertThat(block.getIndexInFile()).isZero(); + Assertions.assertThat(block.getStartLine()).isZero(); + Assertions.assertThat(block.getEndLine()).isZero(); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/es/EsQueueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/es/EsQueueDaoTest.java index 583ea35c1b7..3388967b9ff 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/es/EsQueueDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/es/EsQueueDaoTest.java @@ -81,7 +81,7 @@ public class EsQueueDaoTest { underTest.delete(dbSession, esQueueDtos); - assertThat(dbTester.countSql(dbSession, "select count(*) from es_queue")).isEqualTo(0); + assertThat(dbTester.countSql(dbSession, "select count(*) from es_queue")).isZero(); } @Test @@ -115,7 +115,7 @@ public class EsQueueDaoTest { system2.setNow(1_002L); EsQueueDto i3 = underTest.insert(dbSession, EsQueueDto.create("foo", UuidFactoryFast.getInstance().create())); - assertThat(underTest.selectForRecovery(dbSession, 999, LIMIT)).hasSize(0); + assertThat(underTest.selectForRecovery(dbSession, 999, LIMIT)).isEmpty(); assertThat(underTest.selectForRecovery(dbSession, 1_000, LIMIT)) .extracting(EsQueueDto::getUuid) .containsExactly(i1.getUuid()); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/event/EventDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/event/EventDaoTest.java index e536b4b2128..75856b03d47 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/event/EventDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/event/EventDaoTest.java @@ -214,7 +214,7 @@ public class EventDaoTest { underTest.delete(dbTester.getSession(), "E1"); dbTester.commit(); - assertThat(dbTester.countRowsOfTable("events")).isEqualTo(0); + assertThat(dbTester.countRowsOfTable("events")).isZero(); } } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java index 6813a473440..554078dce24 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java @@ -269,31 +269,31 @@ public class IssueDaoTest { assertThat(result.stream().mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(3); assertThat(result.stream().filter(g -> g.getRuleType() == RuleType.BUG.getDbConstant()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(3); - assertThat(result.stream().filter(g -> g.getRuleType() == RuleType.CODE_SMELL.getDbConstant()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(0); - assertThat(result.stream().filter(g -> g.getRuleType() == RuleType.VULNERABILITY.getDbConstant()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(0); + assertThat(result.stream().filter(g -> g.getRuleType() == RuleType.CODE_SMELL.getDbConstant()).mapToLong(IssueGroupDto::getCount).sum()).isZero(); + assertThat(result.stream().filter(g -> g.getRuleType() == RuleType.VULNERABILITY.getDbConstant()).mapToLong(IssueGroupDto::getCount).sum()).isZero(); assertThat(result.stream().filter(g -> g.getSeverity().equals("CRITICAL")).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(2); assertThat(result.stream().filter(g -> g.getSeverity().equals("MAJOR")).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(1); - assertThat(result.stream().filter(g -> g.getSeverity().equals("MINOR")).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(0); + assertThat(result.stream().filter(g -> g.getSeverity().equals("MINOR")).mapToLong(IssueGroupDto::getCount).sum()).isZero(); assertThat(result.stream().filter(g -> g.getStatus().equals("OPEN")).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(2); assertThat(result.stream().filter(g -> g.getStatus().equals("RESOLVED")).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(1); - assertThat(result.stream().filter(g -> g.getStatus().equals("CLOSED")).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(0); + assertThat(result.stream().filter(g -> g.getStatus().equals("CLOSED")).mapToLong(IssueGroupDto::getCount).sum()).isZero(); assertThat(result.stream().filter(g -> "FALSE-POSITIVE".equals(g.getResolution())).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(1); assertThat(result.stream().filter(g -> g.getResolution() == null).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(2); assertThat(result.stream().filter(g -> g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(3); - assertThat(result.stream().filter(g -> !g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(0); + assertThat(result.stream().filter(g -> !g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isZero(); // test leak result = underTest.selectIssueGroupsByBaseComponent(db.getSession(), file, 999_999_999L); - assertThat(result.stream().filter(g -> g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(0); + assertThat(result.stream().filter(g -> g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isZero(); assertThat(result.stream().filter(g -> !g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(3); // test leak using exact creation time of criticalBug2 issue result = underTest.selectIssueGroupsByBaseComponent(db.getSession(), file, criticalBug2.getIssueCreationTime()); - assertThat(result.stream().filter(g -> g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(0); + assertThat(result.stream().filter(g -> g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isZero(); assertThat(result.stream().filter(g -> !g.isInLeak()).mapToLong(IssueGroupDto::getCount).sum()).isEqualTo(3); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueMapperTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueMapperTest.java index b69e6327341..3660905b3b2 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueMapperTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueMapperTest.java @@ -224,7 +224,7 @@ public class IssueMapperTest { dto.setSelectedAt(1400000000000L); int count = underTest.updateIfBeforeSelectedDate(dto); - assertThat(count).isEqualTo(0); + assertThat(count).isZero(); dbTester.getSession().commit(); // No change diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LiveMeasureDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LiveMeasureDaoTest.java index 004a7fc1f94..489b83e4313 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LiveMeasureDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/measure/LiveMeasureDaoTest.java @@ -498,7 +498,7 @@ public class LiveMeasureDaoTest { // update int count = underTest.upsert(db.getSession(), dto); - assertThat(count).isEqualTo(0); + assertThat(count).isZero(); verifyPersisted(dto); verifyTableSize(1); } @@ -530,7 +530,7 @@ public class LiveMeasureDaoTest { // update int count = underTest.upsert(db.getSession(), dto); - assertThat(count).isEqualTo(0); + assertThat(count).isZero(); verifyPersisted(dto); verifyTableSize(1); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java index 97043ee7491..25169daeeda 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java @@ -59,7 +59,7 @@ public class NotificationQueueDaoTest { public void should_count_notification_queue() { NotificationQueueDto notificationQueueDto = toNotificationQueueDto(new Notification("email")); - assertThat(dao.count()).isEqualTo(0); + assertThat(dao.count()).isZero(); dao.insert(Arrays.asList(notificationQueueDto)); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/permission/GroupPermissionDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/permission/GroupPermissionDaoTest.java index c10fb8533d1..3f602c4a785 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/permission/GroupPermissionDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/permission/GroupPermissionDaoTest.java @@ -565,7 +565,7 @@ public class GroupPermissionDaoTest { underTest.deleteByRootComponentUuid(dbSession, project1.uuid()); dbSession.commit(); - assertThat(db.countSql("select count(uuid) from group_roles where component_uuid='" + project1.uuid() + "'")).isEqualTo(0); + assertThat(db.countSql("select count(uuid) from group_roles where component_uuid='" + project1.uuid() + "'")).isZero(); assertThat(db.countRowsOfTable("group_roles")).isEqualTo(2); } @@ -584,7 +584,7 @@ public class GroupPermissionDaoTest { underTest.deleteByRootComponentUuid(dbSession, project1.uuid()); dbSession.commit(); - assertThat(db.countSql("select count(uuid) from group_roles where component_uuid='" + project1.uuid() + "'")).isEqualTo(0); + assertThat(db.countSql("select count(uuid) from group_roles where component_uuid='" + project1.uuid() + "'")).isZero(); assertThat(db.countRowsOfTable("group_roles")).isEqualTo(3); } @@ -770,8 +770,8 @@ public class GroupPermissionDaoTest { public void deleteByRootComponentUuidAndGroupUuid_has_no_effect_if_component_does_not_exist() { GroupDto group = db.users().insertGroup(); - assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, "1234", null)).isEqualTo(0); - assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, "1234", group.getUuid())).isEqualTo(0); + assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, "1234", null)).isZero(); + assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, "1234", group.getUuid())).isZero(); } @Test @@ -779,15 +779,15 @@ public class GroupPermissionDaoTest { ComponentDto project = randomPublicOrPrivateProject(); GroupDto group = db.users().insertGroup(); - assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, project.uuid(), null)).isEqualTo(0); - assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, project.uuid(), group.getUuid())).isEqualTo(0); + assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, project.uuid(), null)).isZero(); + assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, project.uuid(), group.getUuid())).isZero(); } @Test public void deleteByRootComponentUuidAndGroupUuid_has_no_effect_if_group_does_not_exist() { ComponentDto project = randomPublicOrPrivateProject(); - assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, project.uuid(), "5678")).isEqualTo(0); + assertThat(underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, project.uuid(), "5678")).isZero(); } @Test @@ -804,7 +804,7 @@ public class GroupPermissionDaoTest { int deletedCount = underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, project.uuid(), null); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectProjectPermissionsOfGroup(dbSession, null, project.uuid())) .isEmpty(); assertThat(underTest.selectProjectPermissionsOfGroup(dbSession, group1.getUuid(), project.uuid())) @@ -826,7 +826,7 @@ public class GroupPermissionDaoTest { int deletedCount = underTest.deleteByRootComponentUuidAndGroupUuid(dbSession, project.uuid(), group2.getUuid()); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectProjectPermissionsOfGroup(dbSession, group1.getUuid(), project.uuid())) .containsOnly("p1"); assertThat(underTest.selectProjectPermissionsOfGroup(dbSession, group2.getUuid(), project.uuid())) @@ -876,7 +876,7 @@ public class GroupPermissionDaoTest { db.users().insertPermissionOnAnyone("p1"); db.users().insertPermissionOnGroup(group, "p1"); - assertThat(underTest.deleteByRootComponentUuidAndPermission(dbSession, project.uuid(), "p1")).isEqualTo(0); + assertThat(underTest.deleteByRootComponentUuidAndPermission(dbSession, project.uuid(), "p1")).isZero(); assertThat(getGlobalPermissionsForAnyone()).containsOnly("p1"); assertThat(getGlobalPermissionsForGroup(group)).containsOnly("p1"); @@ -893,7 +893,7 @@ public class GroupPermissionDaoTest { db.users().insertProjectPermissionOnGroup(group, "p1", project); db.users().insertProjectPermissionOnAnyone("p1", project); - assertThat(underTest.deleteByRootComponentUuidAndPermission(dbSession, "1324", "p1")).isEqualTo(0); + assertThat(underTest.deleteByRootComponentUuidAndPermission(dbSession, "1324", "p1")).isZero(); assertThat(getGlobalPermissionsForAnyone()).containsOnly("p1"); assertThat(getGlobalPermissionsForGroup(group)).containsOnly("p1"); @@ -908,7 +908,7 @@ public class GroupPermissionDaoTest { db.users().insertPermissionOnAnyone("p1"); db.users().insertPermissionOnGroup(group, "p1"); - assertThat(underTest.deleteByRootComponentUuidAndPermission(dbSession, project.uuid(), "p1")).isEqualTo(0); + assertThat(underTest.deleteByRootComponentUuidAndPermission(dbSession, project.uuid(), "p1")).isZero(); } private Collection<String> getGlobalPermissionsForAnyone() { @@ -945,7 +945,7 @@ public class GroupPermissionDaoTest { } private void assertThatNoPermission(String permission) { - assertThat(db.countSql("select count(uuid) from group_roles where role='" + permission + "'")).isEqualTo(0); + assertThat(db.countSql("select count(uuid) from group_roles where role='" + permission + "'")).isZero(); } } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/permission/PermissionQueryTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/permission/PermissionQueryTest.java index 0b200fe912b..1fbce9a9e9a 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/permission/PermissionQueryTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/permission/PermissionQueryTest.java @@ -65,7 +65,7 @@ public class PermissionQueryTest { PermissionQuery query = PermissionQuery.builder() .build(); - assertThat(query.getPageOffset()).isEqualTo(0); + assertThat(query.getPageOffset()).isZero(); assertThat(query.getPageSize()).isEqualTo(20); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/permission/UserPermissionDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/permission/UserPermissionDaoTest.java index b27de1c0ad7..253dbbd4de2 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/permission/UserPermissionDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/permission/UserPermissionDaoTest.java @@ -381,7 +381,7 @@ public class UserPermissionDaoTest { // global permission exists -> delete it, but not the project permission with the same name ! underTest.deleteGlobalPermission(dbSession, user1.getUuid(), "perm1"); - assertThat(db.countSql(dbSession, "select count(uuid) from user_roles where role='perm1' and component_uuid is null")).isEqualTo(0); + assertThat(db.countSql(dbSession, "select count(uuid) from user_roles where role='perm1' and component_uuid is null")).isZero(); assertThat(db.countRowsOfTable(dbSession, "user_roles")).isEqualTo(4); } @@ -523,7 +523,7 @@ public class UserPermissionDaoTest { int deletedCount = underTest.deleteProjectPermissionOfAnyUser(dbSession, "124", SCAN.getKey()); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectGlobalPermissionsOfUser(dbSession, user.getUuid())).containsOnly(SCAN.getKey()); } @@ -535,7 +535,7 @@ public class UserPermissionDaoTest { int deletedCount = underTest.deleteProjectPermissionOfAnyUser(dbSession, project.uuid(), SCAN.getKey()); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectGlobalPermissionsOfUser(dbSession, user.getUuid())).containsOnly(SCAN.getKey()); } @@ -548,7 +548,7 @@ public class UserPermissionDaoTest { int deletedCount = underTest.deleteProjectPermissionOfAnyUser(dbSession, project.uuid(), "p1"); - assertThat(deletedCount).isEqualTo(0); + assertThat(deletedCount).isZero(); assertThat(underTest.selectGlobalPermissionsOfUser(dbSession, user.getUuid())).containsOnly(SCAN.getKey()); assertThat(underTest.selectProjectPermissionsOfUser(dbSession, user.getUuid(), project.uuid())).containsOnly(SCAN.getKey()); } @@ -647,11 +647,11 @@ public class UserPermissionDaoTest { private void assertThatProjectPermissionDoesNotExist(UserDto user, String permission, ComponentDto project) { assertThat(db.countSql(dbSession, "select count(uuid) from user_roles where role='" + permission + "' and user_uuid='" + user.getUuid() + "' and component_uuid='" + project.uuid() + "'")) - .isEqualTo(0); + .isZero(); } private void assertThatProjectHasNoPermissions(ComponentDto project) { - assertThat(db.countSql(dbSession, "select count(uuid) from user_roles where component_uuid='" + project.uuid() + "'")).isEqualTo(0); + assertThat(db.countSql(dbSession, "select count(uuid) from user_roles where component_uuid='" + project.uuid() + "'")).isZero(); } private void assertGlobalPermissionsOfUser(UserDto user, GlobalPermission... permissions) { diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/project/ProjectDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/project/ProjectDaoTest.java index 1277cc03065..0d451498d13 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/project/ProjectDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/project/ProjectDaoTest.java @@ -172,7 +172,7 @@ public class ProjectDaoTest { projectDao.insert(db.getSession(), dto3); List<ProjectDto> projectsByUuids = projectDao.selectByUuids(db.getSession(), Collections.emptySet()); - assertThat(projectsByUuids).hasSize(0); + assertThat(projectsByUuids).isEmpty(); } private void assertProject(ProjectDto dto, String name, String kee, String org, String uuid, String desc, @Nullable String tags, boolean isPrivate) { diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/property/InternalComponentPropertiesDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/property/InternalComponentPropertiesDaoTest.java index ea01da4cdf1..366f3cd8147 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/property/InternalComponentPropertiesDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/property/InternalComponentPropertiesDaoTest.java @@ -165,7 +165,7 @@ public class InternalComponentPropertiesDaoTest { public void delete_by_component_uuid_and_key_does_nothing_if_property_doesnt_exist() { saveDto(); - assertThat(underTest.deleteByComponentUuid(dbSession, "other_component")).isEqualTo(0); + assertThat(underTest.deleteByComponentUuid(dbSession, "other_component")).isZero(); assertThat(underTest.selectByComponentUuidAndKey(dbSession, SOME_COMPONENT, SOME_KEY)).isNotEmpty(); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java index 1c94f954b0c..80810c1917b 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java @@ -248,10 +248,10 @@ public class PurgeDaoTest { IssueDto openOnEnabledComponent = db.issues().insert(rule, project, enabledFile, issue -> issue.setStatus("OPEN")); IssueDto confirmOnEnabledComponent = db.issues().insert(rule, project, enabledFile, issue -> issue.setStatus("CONFIRM")); - assertThat(db.countSql("select count(*) from snapshots where purge_status = 1")).isEqualTo(0); + assertThat(db.countSql("select count(*) from snapshots where purge_status = 1")).isZero(); - assertThat(db.countSql("select count(*) from issues where status = 'CLOSED'")).isEqualTo(0); - assertThat(db.countSql("select count(*) from issues where resolution = 'REMOVED'")).isEqualTo(0); + assertThat(db.countSql("select count(*) from issues where status = 'CLOSED'")).isZero(); + assertThat(db.countSql("select count(*) from issues where resolution = 'REMOVED'")).isZero(); db.fileSources().insertFileSource(srcFile); FileSourceDto nonSelectedFileSource = db.fileSources().insertFileSource(enabledFile); @@ -826,7 +826,7 @@ public class PurgeDaoTest { dbSession.commit(); assertThat(db.countRowsOfTable("ce_queue")).isEqualTo(1); - assertThat(db.countSql("select count(*) from ce_queue where main_component_uuid='" + projectToBeDeleted.uuid() + "'")).isEqualTo(0); + assertThat(db.countSql("select count(*) from ce_queue where main_component_uuid='" + projectToBeDeleted.uuid() + "'")).isZero(); } @Test @@ -1160,7 +1160,7 @@ public class PurgeDaoTest { assertThat(selectActivity("VERY_OLD_1")).isEmpty(); assertThat(selectTaskInput("VERY_OLD_1")).isEmpty(); - assertThat(selectTaskCharacteristic("VERY_OLD_1")).hasSize(0); + assertThat(selectTaskCharacteristic("VERY_OLD_1")).isEmpty(); assertThat(scannerContextExists("VERY_OLD_1")).isFalse(); assertThat(selectActivity("VERY_OLD_2")).isNotEmpty(); assertThat(selectTaskInput("VERY_OLD_2")).isNotEmpty(); @@ -1169,7 +1169,7 @@ public class PurgeDaoTest { assertThat(selectActivity("JUST_OLD_ENOUGH_1")).isEmpty(); assertThat(selectTaskInput("JUST_OLD_ENOUGH_1")).isEmpty(); - assertThat(selectTaskCharacteristic("JUST_OLD_ENOUGH_1")).hasSize(0); + assertThat(selectTaskCharacteristic("JUST_OLD_ENOUGH_1")).isEmpty(); assertThat(scannerContextExists("JUST_OLD_ENOUGH_1")).isFalse(); assertThat(selectActivity("JUST_OLD_ENOUGH_2")).isNotEmpty(); assertThat(selectTaskInput("JUST_OLD_ENOUGH_2")).isNotEmpty(); @@ -1218,7 +1218,7 @@ public class PurgeDaoTest { assertThat(selectActivity("VERY_OLD_1")).isEmpty(); assertThat(selectTaskInput("VERY_OLD_1")).isEmpty(); - assertThat(selectTaskCharacteristic("VERY_OLD_1")).hasSize(0); + assertThat(selectTaskCharacteristic("VERY_OLD_1")).isEmpty(); assertThat(scannerContextExists("VERY_OLD_1")).isFalse(); assertThat(selectActivity("VERY_OLD_2")).isEmpty(); assertThat(selectTaskInput("VERY_OLD_2")).isEmpty(); @@ -1227,7 +1227,7 @@ public class PurgeDaoTest { assertThat(selectActivity("JUST_OLD_ENOUGH_1")).isEmpty(); assertThat(selectTaskInput("JUST_OLD_ENOUGH_1")).isEmpty(); - assertThat(selectTaskCharacteristic("JUST_OLD_ENOUGH_1")).hasSize(0); + assertThat(selectTaskCharacteristic("JUST_OLD_ENOUGH_1")).isEmpty(); assertThat(scannerContextExists("JUST_OLD_ENOUGH_1")).isFalse(); assertThat(selectActivity("JUST_OLD_ENOUGH_2")).isEmpty(); assertThat(selectTaskInput("JUST_OLD_ENOUGH_2")).isEmpty(); @@ -1561,12 +1561,12 @@ public class PurgeDaoTest { assertThat(selectActivity("VERY_OLD")).isEmpty(); assertThat(selectTaskInput("VERY_OLD")).isEmpty(); - assertThat(selectTaskCharacteristic("VERY_OLD")).hasSize(0); + assertThat(selectTaskCharacteristic("VERY_OLD")).isEmpty(); assertThat(scannerContextExists("VERY_OLD")).isFalse(); assertThat(selectActivity("JUST_OLD_ENOUGH")).isEmpty(); assertThat(selectTaskInput("JUST_OLD_ENOUGH")).isEmpty(); - assertThat(selectTaskCharacteristic("JUST_OLD_ENOUGH")).hasSize(0); + assertThat(selectTaskCharacteristic("JUST_OLD_ENOUGH")).isEmpty(); assertThat(scannerContextExists("JUST_OLD_ENOUGH")).isFalse(); assertThat(selectActivity("NOT_OLD_ENOUGH")).isNotEmpty(); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java index 20ce6764f80..5a81dd9421f 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java @@ -526,7 +526,7 @@ public class ActiveRuleDaoTest { underTest.deleteParam(dbSession, param); - assertThat(underTest.selectParamsByActiveRuleUuid(dbSession, activeRule.getUuid())).hasSize(0); + assertThat(underTest.selectParamsByActiveRuleUuid(dbSession, activeRule.getUuid())).isEmpty(); } @Test @@ -593,7 +593,7 @@ public class ActiveRuleDaoTest { underTest.deleteParamsByActiveRuleUuids(dbSession, singletonList(ar1.getUuid())); - assertThat(underTest.selectParamsByActiveRuleUuid(dbSession, ar1.getUuid())).hasSize(0); + assertThat(underTest.selectParamsByActiveRuleUuid(dbSession, ar1.getUuid())).isEmpty(); assertThat(underTest.selectParamsByActiveRuleUuid(dbSession, ar2.getUuid())).hasSize(1); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileChangeDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileChangeDaoTest.java index 18c9815f66c..f6f2d0c4451 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileChangeDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileChangeDaoTest.java @@ -198,11 +198,11 @@ public class QProfileChangeDaoTest { assertThat(underTest.countByQuery(dbSession, new QProfileChangeQuery(profile1.getKee()))).isEqualTo(2); assertThat(underTest.countByQuery(dbSession, new QProfileChangeQuery(profile2.getKee()))).isEqualTo(1); - assertThat(underTest.countByQuery(dbSession, new QProfileChangeQuery("does_not_exist"))).isEqualTo(0); + assertThat(underTest.countByQuery(dbSession, new QProfileChangeQuery("does_not_exist"))).isZero(); QProfileChangeQuery query = new QProfileChangeQuery(profile1.getKee()); query.setToExcluded(start); - assertThat(underTest.countByQuery(dbSession, query)).isEqualTo(0); + assertThat(underTest.countByQuery(dbSession, query)).isZero(); QProfileChangeQuery query2 = new QProfileChangeQuery(profile1.getKee()); query2.setToExcluded(end); @@ -219,7 +219,7 @@ public class QProfileChangeDaoTest { underTest.deleteByRulesProfileUuids(dbSession, asList(profile1.getRulesProfileUuid())); - assertThat(underTest.countByQuery(dbSession, new QProfileChangeQuery(profile1.getKee()))).isEqualTo(0); + assertThat(underTest.countByQuery(dbSession, new QProfileChangeQuery(profile1.getKee()))).isZero(); assertThat(underTest.countByQuery(dbSession, new QProfileChangeQuery(profile2.getKee()))).isEqualTo(1); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java index 0f45bb7f4db..c4b78983b83 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java @@ -448,7 +448,7 @@ public class RuleDaoTest { assertThat(ruleDto.getRuleKey()).isEqualTo("NewRuleKey"); assertThat(ruleDto.getRepositoryKey()).isEqualTo("plugin"); assertThat(ruleDto.getConfigKey()).isEqualTo("NewConfigKey"); - assertThat(ruleDto.getSeverity()).isEqualTo(0); + assertThat(ruleDto.getSeverity()).isZero(); assertThat(ruleDto.getLanguage()).isEqualTo("dart"); assertThat(ruleDto.isTemplate()).isTrue(); assertThat(ruleDto.isExternal()).isTrue(); @@ -505,7 +505,7 @@ public class RuleDaoTest { assertThat(ruleDto.getRuleKey()).isEqualTo("NewRuleKey"); assertThat(ruleDto.getRepositoryKey()).isEqualTo("plugin"); assertThat(ruleDto.getConfigKey()).isEqualTo("NewConfigKey"); - assertThat(ruleDto.getSeverity()).isEqualTo(0); + assertThat(ruleDto.getSeverity()).isZero(); assertThat(ruleDto.getLanguage()).isEqualTo("dart"); assertThat(ruleDto.isTemplate()).isTrue(); assertThat(ruleDto.isExternal()).isTrue(); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java index b047b2c3481..d348092715e 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java @@ -141,7 +141,7 @@ public class RuleRepositoryDaoTest { RuleRepositoryDto dto1 = new RuleRepositoryDto("findbugs", "java", "Findbugs"); underTest.insertOrUpdate(dbSession, asList(dto1)); - assertThat(underTest.selectByLanguage(dbSession, "missing")).hasSize(0); + assertThat(underTest.selectByLanguage(dbSession, "missing")).isEmpty(); } private long selectCreatedAtByKey(DbSession dbSession, String key) { diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/source/FileSourceDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/source/FileSourceDaoTest.java index 0acd7441556..25052001869 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/source/FileSourceDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/source/FileSourceDaoTest.java @@ -163,7 +163,7 @@ public class FileSourceDaoTest { FileSourceDto res = underTest.selectByFileUuid(dbSession, fileSourceDto.getFileUuid()); - assertThat(res.getLineCount()).isEqualTo(0); + assertThat(res.getLineCount()).isZero(); assertThat(res.getLineHashes()).isEmpty(); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/user/GroupDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/user/GroupDaoTest.java index 671922b5e83..5f4ce8a4e22 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/user/GroupDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/user/GroupDaoTest.java @@ -216,6 +216,6 @@ public class GroupDaoTest { underTest.deleteByUuid(dbSession, aGroup.getUuid()); - assertThat(db.countRowsOfTable(dbSession, "groups")).isEqualTo(0); + assertThat(db.countRowsOfTable(dbSession, "groups")).isZero(); } } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java index 41989df68b3..e4fecb88010 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java @@ -214,7 +214,7 @@ public class UserDaoTest { @Test public void countRootUsersButLogin_returns_0_when_there_is_no_user_at_all() { - assertThat(underTest.countRootUsersButLogin(session, "bla")).isEqualTo(0); + assertThat(underTest.countRootUsersButLogin(session, "bla")).isZero(); } @Test @@ -222,7 +222,7 @@ public class UserDaoTest { underTest.insert(session, newUserDto()); session.commit(); - assertThat(underTest.countRootUsersButLogin(session, "bla")).isEqualTo(0); + assertThat(underTest.countRootUsersButLogin(session, "bla")).isZero(); } @Test @@ -231,7 +231,7 @@ public class UserDaoTest { insertInactiveRootUser(newUserDto()); session.commit(); - assertThat(underTest.countRootUsersButLogin(session, "bla")).isEqualTo(0); + assertThat(underTest.countRootUsersButLogin(session, "bla")).isZero(); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/webhook/WebhookDeliveryDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/webhook/WebhookDeliveryDaoTest.java index c6b67a5dd2e..96c999c6c87 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/webhook/WebhookDeliveryDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/webhook/WebhookDeliveryDaoTest.java @@ -225,7 +225,7 @@ public class WebhookDeliveryDaoTest { public void deleteComponentBeforeDate_does_nothing_on_empty_table() { underTest.deleteComponentBeforeDate(dbSession, "COMPONENT_1", 1_500_000L); - assertThat(dbTester.countRowsOfTable(dbSession, "webhook_deliveries")).isEqualTo(0); + assertThat(dbTester.countRowsOfTable(dbSession, "webhook_deliveries")).isZero(); } @Test |