@@ -43,7 +43,7 @@ public class SendIssueNotificationsStep implements ComputationStep { | |||
/** | |||
* Types of the notifications sent by this step | |||
*/ | |||
static final Set<String> NOTIF_TYPES = ImmutableSet.of(IssueChangeNotification.TYPE, NewIssuesNotification.TYPE, MyNewIssuesNotification.TYPE); | |||
static final Set<String> NOTIF_TYPES = ImmutableSet.of(IssueChangeNotification.TYPE, NewIssuesNotification.TYPE, MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE); | |||
private final IssueCache issueCache; | |||
private final RuleCache rules; |
@@ -39,7 +39,7 @@ public class MyNewIssuesEmailTemplate extends AbstractNewIssuesEmailTemplate { | |||
@Override | |||
protected boolean shouldNotFormat(Notification notification) { | |||
return !MyNewIssuesNotification.TYPE.equals(notification.getType()); | |||
return !MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE.equals(notification.getType()); | |||
} | |||
@Override |
@@ -29,10 +29,10 @@ import static org.sonar.server.issue.notification.AbstractNewIssuesEmailTemplate | |||
public class MyNewIssuesNotification extends NewIssuesNotification { | |||
public static final String TYPE = "my-new-issues"; | |||
public static final String MY_NEW_ISSUES_NOTIF_TYPE = "my-new-issues"; | |||
MyNewIssuesNotification(UserIndex userIndex, RuleIndex ruleIndex, DbClient dbClient, Durations durations) { | |||
super(TYPE, userIndex, ruleIndex, dbClient, durations); | |||
super(MY_NEW_ISSUES_NOTIF_TYPE, userIndex, ruleIndex, dbClient, durations); | |||
} | |||
public MyNewIssuesNotification setAssignee(String assignee) { |
@@ -34,7 +34,7 @@ public class MyNewIssuesNotificationDispatcher extends NotificationDispatcher { | |||
private final NotificationManager manager; | |||
public MyNewIssuesNotificationDispatcher(NotificationManager manager) { | |||
super(MyNewIssuesNotification.TYPE); | |||
super(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE); | |||
this.manager = manager; | |||
} | |||
@@ -27,6 +27,7 @@ class MeasureFilterSort { | |||
private Metric metric = null; | |||
private Integer period = null; | |||
private boolean asc = true; | |||
MeasureFilterSort() { | |||
} | |||
@@ -129,7 +130,7 @@ class MeasureFilterSort { | |||
} | |||
} | |||
public static enum Field { | |||
public enum Field { | |||
KEY, NAME, VERSION, METRIC, SHORT_NAME, DESCRIPTION, | |||
// Sort by last analysis date | |||
DATE, |
@@ -27,11 +27,11 @@ import java.util.Map; | |||
public class ProjectSettings extends Settings { | |||
private final Settings settings; | |||
private final Map<String, String> properties; | |||
private final Map<String, String> projectProperties; | |||
public ProjectSettings(Settings settings, Map<String, String> properties) { | |||
public ProjectSettings(Settings settings, Map<String, String> projectProperties) { | |||
this.settings = settings; | |||
this.properties = properties; | |||
this.projectProperties = projectProperties; | |||
} | |||
@Override | |||
@@ -67,6 +67,6 @@ public class ProjectSettings extends Settings { | |||
} | |||
private String get(String key) { | |||
return properties.get(key); | |||
return projectProperties.get(key); | |||
} | |||
} |
@@ -130,7 +130,7 @@ public class MyNewIssuesEmailTemplateTest { | |||
@Test | |||
public void do_not_add_footer_when_properties_missing() { | |||
Notification notification = new Notification(MyNewIssuesNotification.TYPE) | |||
Notification notification = new Notification(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE) | |||
.setFieldValue(SEVERITY + ".count", "32") | |||
.setFieldValue("projectName", "Struts"); | |||
@@ -139,7 +139,7 @@ public class MyNewIssuesEmailTemplateTest { | |||
} | |||
private Notification newNotification() { | |||
return new Notification(MyNewIssuesNotification.TYPE) | |||
return new Notification(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE) | |||
.setFieldValue("projectName", "Struts") | |||
.setFieldValue("projectKey", "org.apache:struts") | |||
.setFieldValue("projectUuid", "ABCDE") |
@@ -61,7 +61,7 @@ public class MyNewIssuesNotificationDispatcherTest { | |||
recipients.put("user2", twitterChannel); | |||
when(notificationManager.findNotificationSubscribers(sut, "struts")).thenReturn(recipients); | |||
Notification notification = new Notification(MyNewIssuesNotification.TYPE) | |||
Notification notification = new Notification(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE) | |||
.setFieldValue("projectKey", "struts") | |||
.setFieldValue("assignee", "user1"); | |||
sut.performDispatch(notification, context); |
@@ -43,7 +43,7 @@ public class MyNewIssuesNotificationTest { | |||
@Test | |||
public void set_with_a_specific_type() { | |||
assertThat(sut.getType()).isEqualTo(MyNewIssuesNotification.TYPE); | |||
assertThat(sut.getType()).isEqualTo(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE); | |||
} | |||
} |