use of org.sonar.server.project.Project in project sonarqube by SonarSource.
the class SendIssueNotificationsStepTest method do_not_send_new_issues_notifications_for_hotspot.
@Test
public void do_not_send_new_issues_notifications_for_hotspot() {
UserDto user = db.users().insertUser();
ComponentDto project = newPrivateProjectDto().setDbKey(PROJECT.getDbKey()).setLongName(PROJECT.getName());
ComponentDto file = newFileDto(project).setDbKey(FILE.getDbKey()).setLongName(FILE.getName());
RuleDefinitionDto ruleDefinitionDto = newRule();
prepareIssue(ANALYSE_DATE, user, project, file, ruleDefinitionDto, RuleType.SECURITY_HOTSPOT);
analysisMetadataHolder.setProject(new Project(PROJECT.getUuid(), PROJECT.getKey(), PROJECT.getName(), null, emptyList()));
when(notificationService.hasProjectSubscribersForTypes(PROJECT.getUuid(), NOTIF_TYPES)).thenReturn(true);
TestComputationStepContext context = new TestComputationStepContext();
underTest.execute(context);
verify(notificationService, never()).deliver(any(Notification.class));
verify(notificationService, never()).deliverEmails(anyCollection());
verifyStatistics(context, 0, 0, 0);
}
Aggregations