.setFieldValue("projectName", project.getLongName())
.setFieldValue("projectKey", project.getKey())
.setFieldValue("projectId", String.valueOf(project.getId()))
- .setFieldValue("fromDate", dateformat.format(pastSnapshot.getTargetDate()))
- .setFieldValue("toDate", dateformat.format(new Date()));
+ .setFieldValue("fromDate", dateformat.format(pastSnapshot.getTargetDate()));
notificationManager.scheduleForSending(notification);
}
}
.setFieldValue("projectName", "LongName")
.setFieldValue("projectKey", "key")
.setFieldValue("projectId", "45")
- .setFieldValue("fromDate", dateformat.format(pastDate.getTime()))
- .setFieldValue("toDate", dateformat.format(new Date()));
+ .setFieldValue("fromDate", dateformat.format(pastDate.getTime()));
verify(notificationManager, times(1)).scheduleForSending(eq(notification));
}
String projectName = notification.getFieldValue("projectName");
String violationsCount = notification.getFieldValue("count");
String fromDate = notification.getFieldValue("fromDate");
- String toDate = notification.getFieldValue("toDate");
sb.append("Project: ").append(projectName).append('\n');
- sb.append(violationsCount).append(" new violations on last analysis");
- sb.append(" (introduced between ").append(fromDate).append(" and ").append(toDate).append(")").append('\n');
+ sb.append(violationsCount).append(" new violations introduced since ").append(fromDate).append('\n');
appendFooter(sb, notification);
EmailMessage message = new EmailMessage()
.setFieldValue("projectName", "Foo")
.setFieldValue("projectKey", "org.sonar.foo:foo")
.setFieldValue("projectId", "45")
- .setFieldValue("fromDate", "2012-01-02")
- .setFieldValue("toDate", "2012-01-15");
+ .setFieldValue("fromDate", "2012-01-02");
EmailMessage message = template.format(notification);
assertThat(message.getMessageId(), is("new-violations/45"));
assertThat(message.getSubject(), is("New violations for project Foo"));
assertThat(message.getMessage(), is("" +
"Project: Foo\n" +
- "32 new violations on last analysis (introduced between 2012-01-02 and 2012-01-15)\n" +
+ "32 new violations introduced since 2012-01-02\n" +
"\n" +
"See it in Sonar: http://nemo.sonarsource.org/drilldown/measures/org.sonar.foo:foo?metric=new_violations&period=1\n"));
}