use of org.sonar.server.notification.NotificationManager.EmailRecipient in project sonarqube by SonarSource.
the class EmailRecipientTest method constructor_fails_with_NPE_if_login_is_null.
@Test
public void constructor_fails_with_NPE_if_login_is_null() {
String email = randomAlphabetic(12);
assertThatThrownBy(() -> new EmailRecipient(null, email)).isInstanceOf(NullPointerException.class).hasMessage("login can't be null");
}
use of org.sonar.server.notification.NotificationManager.EmailRecipient in project sonarqube by SonarSource.
the class EmailRecipientTest method hashcode_is_based_on_login_and_email.
@Test
public void hashcode_is_based_on_login_and_email() {
String login = randomAlphabetic(11);
String email = randomAlphabetic(12);
EmailRecipient underTest = new EmailRecipient(login, email);
assertThat(underTest.hashCode()).isEqualTo(new EmailRecipient(login, email).hashCode()).isNotEqualTo(new Object().hashCode()).isNotEqualTo(new EmailRecipient(email, login).hashCode()).isNotEqualTo(new EmailRecipient(randomAlphabetic(5), email).hashCode()).isNotEqualTo(new EmailRecipient(login, randomAlphabetic(5)).hashCode()).isNotEqualTo(new EmailRecipient(randomAlphabetic(5), randomAlphabetic(6)).hashCode());
}
use of org.sonar.server.notification.NotificationManager.EmailRecipient in project sonarqube by SonarSource.
the class EmailRecipientTest method verify_to_String.
@Test
public void verify_to_String() {
String login = randomAlphabetic(11);
String email = randomAlphabetic(12);
assertThat(new EmailRecipient(login, email).toString()).isEqualTo("EmailRecipient{'" + login + "':'" + email + "'}");
}
Aggregations