use of org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.AnalysisChange in project sonarqube by SonarSource.
the class IssuesChangesNotificationBuilderTest method AnalysisChange_not_equal_with_Object.
@Test
public void AnalysisChange_not_equal_with_Object() {
AnalysisChange analysisChange1 = new AnalysisChange(1_000_000_000L);
assertThat(analysisChange1).isNotEqualTo(new Object());
}
use of org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.AnalysisChange in project sonarqube by SonarSource.
the class IssuesChangesNotificationBuilderTest method AnalysisChange_isAuthorLogin.
@Test
public void AnalysisChange_isAuthorLogin() {
AnalysisChange analysisChange1 = new AnalysisChange(1_000_000_000L);
assertThat(analysisChange1.isAuthorLogin("login")).isFalse();
}
use of org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.AnalysisChange in project sonarqube by SonarSource.
the class ChangesOnMyIssuesNotificationTest method hashcode_is_based_on_change_and_issues.
@Test
public void hashcode_is_based_on_change_and_issues() {
AnalysisChange analysisChange = new AnalysisChange(new Random().nextLong());
ChangedIssue changedIssue = IssuesChangesNotificationBuilderTesting.newChangedIssue("doo", IssuesChangesNotificationBuilderTesting.newProject("prj"), newRandomNotAHotspotRule("rul"));
ChangesOnMyIssuesNotification underTest = new ChangesOnMyIssuesNotification(analysisChange, ImmutableSet.of(changedIssue));
assertThat(underTest.hashCode()).isEqualTo(new ChangesOnMyIssuesNotification(analysisChange, ImmutableSet.of(changedIssue)).hashCode()).isNotEqualTo(mock(Notification.class).hashCode()).isNotEqualTo(new ChangesOnMyIssuesNotification(new AnalysisChange(analysisChange.getDate() + 10), ImmutableSet.of(changedIssue)).hashCode()).isNotEqualTo(new ChangesOnMyIssuesNotification(analysisChange, ImmutableSet.of())).hashCode();
}
use of org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.AnalysisChange in project sonarqube by SonarSource.
the class FpOrWontFixEmailTemplateTest method fpOrWontFixValuesByUserOrAnalysisChange.
@DataProvider
public static Object[][] fpOrWontFixValuesByUserOrAnalysisChange() {
AnalysisChange analysisChange = new AnalysisChange(new Random().nextLong());
UserChange userChange = new UserChange(new Random().nextLong(), new User(randomAlphabetic(5), randomAlphabetic(6), new Random().nextBoolean() ? null : randomAlphabetic(7)));
return new Object[][] { { analysisChange, FP }, { analysisChange, WONT_FIX }, { userChange, FP }, { userChange, WONT_FIX } };
}
use of org.sonar.server.issue.notification.IssuesChangesNotificationBuilder.AnalysisChange in project sonarqube by SonarSource.
the class FpOrWontFixEmailTemplateTest method userOrAnalysisChange.
@DataProvider
public static Object[][] userOrAnalysisChange() {
AnalysisChange analysisChange = new AnalysisChange(new Random().nextLong());
UserChange userChange = new UserChange(new Random().nextLong(), new User(randomAlphabetic(5), randomAlphabetic(6), new Random().nextBoolean() ? null : randomAlphabetic(7)));
return new Object[][] { { analysisChange }, { userChange } };
}
Aggregations