use of org.sonar.server.issue.notification.IssuesChangesNotificationBuilderTesting.newAnalysisChange in project sonarqube by SonarSource.
the class ChangesOnMyIssuesEmailTemplateTest method format_sets_subject_with_project_name_of_first_issue_in_set_when_change_from_Analysis.
@Test
public void format_sets_subject_with_project_name_of_first_issue_in_set_when_change_from_Analysis() {
Set<ChangedIssue> changedIssues = IntStream.range(0, 2 + new Random().nextInt(4)).mapToObj(i -> newChangedIssue(i + "", randomValidStatus(), newProject("prj_" + i), newRandomNotAHotspotRule("rule_" + i))).collect(toSet());
AnalysisChange analysisChange = IssuesChangesNotificationBuilderTesting.newAnalysisChange();
EmailMessage emailMessage = underTest.format(new ChangesOnMyIssuesNotification(analysisChange, changedIssues));
Project project = changedIssues.iterator().next().getProject();
assertThat(emailMessage.getSubject()).isEqualTo("Analysis has changed some of your issues in " + project.getProjectName());
}
Aggregations