Search in sources :

Example 1 with NewIssuesNotification

use of org.sonar.server.issue.notification.NewIssuesNotification in project sonarqube by SonarSource.

the class SendIssueNotificationsStep method sendNewIssuesNotification.

private void sendNewIssuesNotification(NewIssuesStatistics statistics, Component project, long analysisDate) {
    NewIssuesStatistics.Stats globalStatistics = statistics.globalStatistics();
    NewIssuesNotification notification = newIssuesNotificationFactory.newNewIssuesNotication().setProject(project.getKey(), project.getUuid(), project.getName()).setAnalysisDate(new Date(analysisDate)).setStatistics(project.getName(), globalStatistics).setDebt(globalStatistics.debt());
    service.deliver(notification);
}
Also used : NewIssuesNotification(org.sonar.server.issue.notification.NewIssuesNotification) MyNewIssuesNotification(org.sonar.server.issue.notification.MyNewIssuesNotification) NewIssuesStatistics(org.sonar.server.issue.notification.NewIssuesStatistics) Date(java.util.Date)

Example 2 with NewIssuesNotification

use of org.sonar.server.issue.notification.NewIssuesNotification in project sonarqube by SonarSource.

the class SendIssueNotificationsStepTest method createNewIssuesNotificationMock.

private NewIssuesNotification createNewIssuesNotificationMock() {
    NewIssuesNotification notification = mock(NewIssuesNotification.class);
    when(notification.setProject(anyString(), anyString(), anyString())).thenReturn(notification);
    when(notification.setAnalysisDate(any(Date.class))).thenReturn(notification);
    when(notification.setStatistics(anyString(), any(NewIssuesStatistics.Stats.class))).thenReturn(notification);
    when(notification.setDebt(any(Duration.class))).thenReturn(notification);
    return notification;
}
Also used : NewIssuesNotification(org.sonar.server.issue.notification.NewIssuesNotification) MyNewIssuesNotification(org.sonar.server.issue.notification.MyNewIssuesNotification) Duration(org.sonar.api.utils.Duration) Date(java.util.Date)

Aggregations

Date (java.util.Date)2 MyNewIssuesNotification (org.sonar.server.issue.notification.MyNewIssuesNotification)2 NewIssuesNotification (org.sonar.server.issue.notification.NewIssuesNotification)2 Duration (org.sonar.api.utils.Duration)1 NewIssuesStatistics (org.sonar.server.issue.notification.NewIssuesStatistics)1