mirror of
https://github.com/google/nomulus.git
synced 2025-08-06 01:35:17 +02: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:
parent
4240be268a
commit
308d5eb76b
10 changed files with 137 additions and 24 deletions
|
@ -149,24 +149,6 @@ public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase
|
|||
assertMetric(CLIENT_ID, "update", "[OWNER]", "ERROR: FormFieldException");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate_emptyJsonObject_emailFieldNotRequiredWhenEmpty() {
|
||||
persistResource(loadRegistrar(CLIENT_ID).asBuilder().setEmailAddress(null).build());
|
||||
Map<String, Object> args = Maps.newHashMap(loadRegistrar(CLIENT_ID).toJsonMap());
|
||||
args.remove("emailAddress");
|
||||
|
||||
Map<String, Object> response = action.handleJsonRequest(ImmutableMap.of(
|
||||
"op", "update",
|
||||
"id", CLIENT_ID,
|
||||
"args", args));
|
||||
|
||||
assertThat(response).containsExactly(
|
||||
"status", "SUCCESS",
|
||||
"message", "Saved TheRegistrar",
|
||||
"results", ImmutableList.of(loadRegistrar(CLIENT_ID).toJsonMap()));
|
||||
assertMetric(CLIENT_ID, "update", "[OWNER]", "SUCCESS");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_updateRegistrarInfo_notAuthorized() {
|
||||
setUserWithoutAccess();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue