if (issue.isNew() && issue.resolution() == null) {
newIssues++;
}
- if (issue.isChanged()) {
+ if (!issue.isNew() && issue.isChanged()) {
Rule rule = ruleFinder.findByKey(issue.ruleKey());
// TODO warning - rules with status REMOVED are currently ignored, but should not
if (rule != null) {
}
@Test
- public void should_send_notif_if_issue_change() throws Exception {
-
+ public void should_send_notification_if_issue_change() throws Exception {
when(project.getAnalysisDate()).thenReturn(DateUtils.parseDate("2013-05-18"));
RuleKey ruleKey = RuleKey.of("squid", "AvoidCycles");
Rule rule = new Rule("squid", "AvoidCycles");
DefaultIssue issue = new DefaultIssue()
+ .setNew(false)
.setChanged(true)
.setFieldChange(mock(IssueChangeContext.class), "severity", "MINOR", "BLOCKER")
.setRuleKey(ruleKey);
}
@Test
- public void should_not_send_notif_if_issue_change_on_removed_rule() throws Exception {
+ public void should_not_send_notification_if_issue_change_on_removed_rule() throws Exception {
IssueChangeContext changeContext = mock(IssueChangeContext.class);
when(project.getAnalysisDate()).thenReturn(DateUtils.parseDate("2013-05-18"));