mirror of
https://github.com/google/nomulus
synced 2026-09-21 07:24:26 +00:00
Validate provided email addresses when creating a Registrar
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=240574585
This commit is contained in:
@@ -815,6 +815,17 @@ public class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarC
|
||||
assertThat(loadRegistrar("NewRegistrar").getPoNumber()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_badEmail() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> runCommand("--email=lolcat", "--force", "NewRegistrar"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Provided email lolcat is not a valid email address");
|
||||
}
|
||||
|
||||
private void persistWhoisAbuseContact() {
|
||||
persistResource(
|
||||
AppEngineRule.makeRegistrarContact1()
|
||||
|
||||
Reference in New Issue
Block a user