use of org.sonar.api.notifications.Notification in project sonarqube by SonarSource.
the class MyNewIssuesEmailTemplateTest method format_email_with_no_assignees_tags_nor_components.
@Test
public void format_email_with_no_assignees_tags_nor_components() {
Notification notification = newNotification(32).setFieldValue("projectVersion", "52.0");
EmailMessage message = underTest.format(notification);
// TODO datetime to be completed when test is isolated from JVM timezone
assertThat(message.getMessage()).startsWith("Project: Struts\n" + "Version: 52.0\n" + "\n" + "32 new issues (new debt: 1d3h)\n" + "\n" + " Type\n" + " Bug: 1 Vulnerability: 3 Code Smell: 0\n" + "\n" + "More details at: http://nemo.sonarsource.org/project/issues?id=org.apache%3Astruts&assignees=lo.gin&createdAt=2010-05-18");
}
use of org.sonar.api.notifications.Notification in project sonarqube by SonarSource.
the class NewIssuesEmailTemplateTest method subject.
@Test
public void subject() {
Notification notification = newNotification(32);
EmailMessage message = template.format(notification);
assertThat(message.getSubject()).isEqualTo("Struts: 32 new issues (new debt: 1d3h)");
}
use of org.sonar.api.notifications.Notification in project sonarqube by SonarSource.
the class NewIssuesEmailTemplateTest method subject_on_branch.
@Test
public void subject_on_branch() {
Notification notification = newNotification(32).setFieldValue("branch", "feature1");
EmailMessage message = template.format(notification);
assertThat(message.getSubject()).isEqualTo("Struts (feature1): 32 new issues (new debt: 1d3h)");
}
use of org.sonar.api.notifications.Notification in project sonarqube by SonarSource.
the class NewIssuesEmailTemplateTest method format_email_supports_single_issue.
@Test
public void format_email_supports_single_issue() {
Notification notification = newNotification(1);
EmailMessage message = template.format(notification);
assertThat(message.getSubject()).isEqualTo("Struts: 1 new issue (new debt: 1d3h)");
assertThat(message.getMessage()).contains("1 new issue (new debt: 1d3h)\n");
}
use of org.sonar.api.notifications.Notification in project sonarqube by SonarSource.
the class NewIssuesEmailTemplateTest method no_format_is_not_the_correct_notification.
@Test
public void no_format_is_not_the_correct_notification() {
Notification notification = new Notification("my-new-issues");
EmailMessage message = template.format(notification);
assertThat(message).isNull();
}
Aggregations