for (Iterator<RuleType> ruleTypeIterator = Arrays.asList(RuleType.BUG, RuleType.VULNERABILITY, RuleType.CODE_SMELL).iterator(); ruleTypeIterator.hasNext();) {
RuleType ruleType = ruleTypeIterator.next();
- String ruleTypeLabel = i18n.message(getLocale(), "rule_type." + ruleType, ruleType.name());
+ String ruleTypeLabel = i18n.message(getLocale(), "issue.type." + ruleType, ruleType.name());
message.append(ruleTypeLabel).append(": ").append(notification.getFieldValue(Metric.RULE_TYPE + DOT + ruleType + COUNT));
if (ruleTypeIterator.hasNext()) {
message.append(TAB);
// returns the login passed in parameter
when(userIndex.getNullableByLogin(anyString()))
.thenAnswer((Answer<UserDoc>) invocationOnMock -> new UserDoc().setName((String) invocationOnMock.getArguments()[0]));
- when(i18n.message(any(Locale.class), eq("rule_type.BUG"), anyString())).thenReturn("Bug");
- when(i18n.message(any(Locale.class), eq("rule_type.CODE_SMELL"), anyString())).thenReturn("Code Smell");
- when(i18n.message(any(Locale.class), eq("rule_type.VULNERABILITY"), anyString())).thenReturn("Vulnerability");
+ when(i18n.message(any(Locale.class), eq("issue.type.BUG"), anyString())).thenReturn("Bug");
+ when(i18n.message(any(Locale.class), eq("issue.type.CODE_SMELL"), anyString())).thenReturn("Code Smell");
+ when(i18n.message(any(Locale.class), eq("issue.type.VULNERABILITY"), anyString())).thenReturn("Vulnerability");
underTest = new MyNewIssuesEmailTemplate(settings, i18n);
}
// returns the login passed in parameter
when(userIndex.getNullableByLogin(anyString()))
.thenAnswer((Answer<UserDoc>) invocationOnMock -> new UserDoc().setName((String) invocationOnMock.getArguments()[0]));
- when(i18n.message(any(Locale.class), eq("rule_type.CODE_SMELL"), anyString())).thenReturn("Code Smell");
- when(i18n.message(any(Locale.class), eq("rule_type.VULNERABILITY"), anyString())).thenReturn("Vulnerability");
- when(i18n.message(any(Locale.class), eq("rule_type.BUG"), anyString())).thenReturn("Bug");
+ when(i18n.message(any(Locale.class), eq("issue.type.CODE_SMELL"), anyString())).thenReturn("Code Smell");
+ when(i18n.message(any(Locale.class), eq("issue.type.VULNERABILITY"), anyString())).thenReturn("Vulnerability");
+ when(i18n.message(any(Locale.class), eq("issue.type.BUG"), anyString())).thenReturn("Bug");
template = new NewIssuesEmailTemplate(settings, i18n);
}
@Parameter
public boolean privateProject;
-
@BeforeClass
public static void setUp() {
smtpServer = new Wiser(0);
extractBodies(smtpServer.getMessages()).forEach(
message -> assertThat(message)
- .contains("Project: Sample")
- .contains("Version: " + version)
- .contains("17 new issues (new debt: 17min)")
- .contains("Type")
- .contains("One Issue Per Line (xoo): 17")
- .contains("More details at: http://localhost:9000/project/issues?id=sample&createdAt=2015-12-15T00%3A00%3A00%2B")
- );
+ .contains("Project: Sample")
+ .contains("Version: " + version)
+ .contains("17 new issues (new debt: 17min)")
+ .contains("Type")
+ .contains("Bug: ").contains("Code Smell: ").contains("Vulnerability: ")
+ .contains("One Issue Per Line (xoo): 17")
+ .contains("More details at: http://localhost:9000/project/issues?id=sample&createdAt=2015-12-15T00%3A00%3A00%2B"));
clearSmtpMessages();
}
"sonar.projectVersion", version,
"sonar.scm.provider", "xoo",
"sonar.scm.disabled", "false",
- "sonar.exclusions", "**/*"
- );
+ "sonar.exclusions", "**/*");
// No email since all code is ignored
waitUntilAllNotificationsAreDelivered(1);
runAnalysis("issue/xoo-with-scm",
"sonar.projectVersion", version,
"sonar.scm.provider", "xoo",
- "sonar.scm.disabled", "false"
- );
+ "sonar.scm.disabled", "false");
// We expect to receive a notification for each subscriber with UserRole.user
// And a personalized email for the assignee userWithUserRole