use of org.sonar.server.es.TestProjectIndexers in project sonarqube by SonarSource.
the class DeleteActionTest method project_deletion_also_ensure_that_webhooks_on_this_project_if_they_exists_are_deleted.
@Test
public void project_deletion_also_ensure_that_webhooks_on_this_project_if_they_exists_are_deleted() {
ProjectDto project = componentDbTester.insertPrivateProjectDto();
webhookDbTester.insertWebhook(project);
webhookDbTester.insertWebhook(project);
webhookDbTester.insertWebhook(project);
webhookDbTester.insertWebhook(project);
userSessionRule.logIn().addProjectPermission(ADMIN, project);
DeleteAction underTest = new DeleteAction(new ComponentCleanerService(dbClient, mockResourceTypes, new TestProjectIndexers()), from(db), dbClient, userSessionRule, projectLifeCycleListeners);
new WsActionTester(underTest).newRequest().setParam(PARAM_PROJECT, project.getKey()).execute();
List<WebhookDto> webhookDtos = dbClient.webhookDao().selectByProject(dbSession, project);
assertThat(webhookDtos).isEmpty();
}
use of org.sonar.server.es.TestProjectIndexers in project sonarqube by SonarSource.
the class DeleteActionTest method project_deletion_also_ensure_that_homepage_on_this_project_if_it_exists_is_cleared.
@Test
public void project_deletion_also_ensure_that_homepage_on_this_project_if_it_exists_is_cleared() {
ComponentDto project = componentDbTester.insertPrivateProject();
UserDto insert = dbClient.userDao().insert(dbSession, newUserDto().setHomepageType("PROJECT").setHomepageParameter(project.uuid()));
dbSession.commit();
userSessionRule.logIn().addProjectPermission(ADMIN, project);
DeleteAction underTest = new DeleteAction(new ComponentCleanerService(dbClient, mockResourceTypes, new TestProjectIndexers()), from(db), dbClient, userSessionRule, projectLifeCycleListeners);
new WsActionTester(underTest).newRequest().setParam(PARAM_PROJECT, project.getDbKey()).execute();
UserDto userReloaded = dbClient.userDao().selectByUuid(dbSession, insert.getUuid());
assertThat(userReloaded.getHomepageType()).isNull();
assertThat(userReloaded.getHomepageParameter()).isNull();
}
Aggregations