}
private void appendFooter(StringBuilder sb, Notification notification) {
- String projectKey = notification.getFieldValue(FIELD_PROJECT_KEY);
+ String projectUuid = notification.getFieldValue("projectUuid");
String dateString = notification.getFieldValue(FIELD_PROJECT_DATE);
- if (projectKey != null && dateString != null) {
+ if (projectUuid != null && dateString != null) {
Date date = DateUtils.parseDateTime(dateString);
- String url = String.format("%s/issues/search#componentRoots=%s|createdAt=%s",
- settings.getServerBaseURL(), encode(projectKey), encode(DateUtils.formatDateTime(date)));
+ String url = String.format("%s/issues/search#componentRootUUids=%s|createdAt=%s",
+ settings.getServerBaseURL(), encode(projectUuid), encode(DateUtils.formatDateTime(date)));
sb.append("\n").append("See it in SonarQube: ").append(url).append("\n");
}
}
*/
package org.sonar.plugins.core.issue.notification;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.sonar.plugins.emailnotifications.api.EmailMessage;
import java.util.Locale;
-import java.util.TimeZone;
import static org.fest.assertions.Assertions.assertThat;
-import static org.mockito.Matchers.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
.setFieldValue("count-BLOCKER", "0")
.setFieldValue("projectName", "Struts")
.setFieldValue("projectKey", "org.apache:struts")
+ .setFieldValue("projectUuid", "ABCDE")
.setFieldValue("projectDate", "2010-05-18T14:50:45+0000");
when(i18n.message(any(Locale.class), eq("severity.BLOCKER"), anyString())).thenReturn("Blocker");
"\n" +
" Blocker: 0 Critical: 5 Major: 10 Minor: 3 Info: 1\n" +
"\n" +
- "See it in SonarQube: http://nemo.sonarsource.org/issues/search#componentRoots=org.apache%3Astruts|createdAt=2010-05-1");
+ "See it in SonarQube: http://nemo.sonarsource.org/issues/search#componentRootUUids=ABCDE|createdAt=2010-05-1");
}
@Test
Notification notification = newNotification(project, "new-issues")
.setDefaultMessage(newIssues.size() + " new issues on " + project.getLongName() + ".\n")
.setFieldValue("projectDate", DateUtils.formatDateTime(project.getAnalysisDate()))
+ .setFieldValue("projectUuid", project.getUuid())
.setFieldValue("count", String.valueOf(newIssues.size()));
for (String severity : Severity.ALL) {
notification.setFieldValue("count-" + severity, String.valueOf(newIssues.issues(severity)));