/** * Test that SQL queries execution do not fail with a huge number of parameter */ @Test public void should_not_fail_when_deleting_huge_number_of_analyses() { new PurgeCommands(dbTester.getSession(), profiler).deleteAnalyses(getHugeNumberOfIdUuidPairs()); // The goal of this test is only to check that the query do no fail, not to check result }
@Test public void deletePermissions_deletes_permissions_of_public_project() { OrganizationDto organization = dbTester.organizations().insert(); ComponentDto project = dbTester.components().insertPublicProject(organization); addPermissions(organization, project); PurgeCommands purgeCommands = new PurgeCommands(dbTester.getSession(), profiler); purgeCommands.deletePermissions(project.getId()); assertThat(dbTester.countRowsOfTable("group_roles")).isEqualTo(2); assertThat(dbTester.countRowsOfTable("user_roles")).isEqualTo(1); }
@Test public void deletePermissions_deletes_permissions_of_private_project() { OrganizationDto organization = dbTester.organizations().insert(); ComponentDto project = dbTester.components().insertPrivateProject(organization); addPermissions(organization, project); PurgeCommands purgeCommands = new PurgeCommands(dbTester.getSession(), profiler); purgeCommands.deletePermissions(project.getId()); assertThat(dbTester.countRowsOfTable("group_roles")).isEqualTo(1); assertThat(dbTester.countRowsOfTable("user_roles")).isEqualTo(1); }
@Test public void deletePermissions_deletes_permissions_of_view() { OrganizationDto organization = dbTester.organizations().insert(); ComponentDto project = dbTester.components().insertPublicPortfolio(organization); addPermissions(organization, project); PurgeCommands purgeCommands = new PurgeCommands(dbTester.getSession(), profiler); purgeCommands.deletePermissions(project.getId()); assertThat(dbTester.countRowsOfTable("group_roles")).isEqualTo(2); assertThat(dbTester.countRowsOfTable("user_roles")).isEqualTo(1); }
/** * Test that SQL queries execution do not fail with a huge number of parameter */ @Test public void should_not_fail_when_purging_huge_number_of_analyses() { new PurgeCommands(dbTester.getSession(), profiler).purgeAnalyses(getHugeNumberOfIdUuidPairs()); // The goal of this test is only to check that the query do no fail, not to check result }