1
0
mirror of https://github.com/google/nomulus synced 2026-01-05 04:56:03 +00:00

Add more tests in RegistrarTest

This commit is contained in:
Gus Brodman
2019-06-13 18:04:57 -04:00
parent 7cf0dce057
commit db932fe336

View File

@@ -469,6 +469,16 @@ public class RegistrarTest extends EntityTestCase {
.isEqualTo("Provided email lolcat is not a valid email address");
}
@Test
public void testFailure_emptyEmail() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class, () -> registrar.asBuilder().setEmailAddress(""));
assertThat(thrown)
.hasMessageThat()
.isEqualTo("Provided email is not a valid email address");
}
@Test
public void testFailure_nullIcannReferralEmail() {
NullPointerException thrown =
@@ -478,7 +488,7 @@ public class RegistrarTest extends EntityTestCase {
}
@Test
public void testFailure_invalidIcannEmail() {
public void testFailure_invalidIcannReferralEmail() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,
@@ -488,6 +498,16 @@ public class RegistrarTest extends EntityTestCase {
.isEqualTo("Provided email lolcat is not a valid email address");
}
@Test
public void testFailure_emptyIcannReferralEmail() {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class, () -> registrar.asBuilder().setEmailAddress(""));
assertThat(thrown)
.hasMessageThat()
.isEqualTo("Provided email is not a valid email address");
}
@Test
public void testSuccess_setAllowedTldsUncached_newTldNotInCache() {
int origSingletonCacheRefreshSeconds =