/**
* 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;
@Override
protected boolean shouldNotFormat(Notification notification) {
- return !MyNewIssuesNotification.TYPE.equals(notification.getType());
+ return !MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE.equals(notification.getType());
}
@Override
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) {
private final NotificationManager manager;
public MyNewIssuesNotificationDispatcher(NotificationManager manager) {
- super(MyNewIssuesNotification.TYPE);
+ super(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE);
this.manager = manager;
}
private Metric metric = null;
private Integer period = null;
private boolean asc = true;
+
MeasureFilterSort() {
}
}
}
- public static enum Field {
+ public enum Field {
KEY, NAME, VERSION, METRIC, SHORT_NAME, DESCRIPTION,
// Sort by last analysis date
DATE,
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
}
private String get(String key) {
- return properties.get(key);
+ return projectProperties.get(key);
}
}
@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");
}
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")
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);
@Test
public void set_with_a_specific_type() {
- assertThat(sut.getType()).isEqualTo(MyNewIssuesNotification.TYPE);
+ assertThat(sut.getType()).isEqualTo(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE);
}
}