diff --git a/java/google/registry/config/RegistryConfig.java b/java/google/registry/config/RegistryConfig.java index 8ababb92f..24ed9c547 100644 --- a/java/google/registry/config/RegistryConfig.java +++ b/java/google/registry/config/RegistryConfig.java @@ -163,7 +163,7 @@ public interface RegistryConfig { * Returns the email address(es) that notifications of registrar and/or registrar contact updates * should be sent to, or the empty list if updates should not be sent. * - * @see google.registry.ui.server.registrar.RegistrarAction + * @see google.registry.ui.server.registrar.RegistrarSettingsAction */ public ImmutableList getRegistrarChangesNotificationEmailAddresses(); diff --git a/java/google/registry/ui/server/registrar/RegistrarSettingsAction.java b/java/google/registry/ui/server/registrar/RegistrarSettingsAction.java index 14a66577c..ef7dec491 100644 --- a/java/google/registry/ui/server/registrar/RegistrarSettingsAction.java +++ b/java/google/registry/ui/server/registrar/RegistrarSettingsAction.java @@ -110,7 +110,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA case "update": return update(args, initialRegistrar); case "read": - return read(args, initialRegistrar); + return JsonResponseHelper.create(SUCCESS, "Success", initialRegistrar.toJsonMap()); default: return JsonResponseHelper.create(ERROR, "Unknown or unsupported operation: " + op); } @@ -293,10 +293,6 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA } } - public Map read(Map args, Registrar registrar) { - return JsonResponseHelper.create(SUCCESS, "Success", registrar.toJsonMap()); - } - /** Thrown when a set of contacts doesn't meet certain constraints. */ private static class ContactRequirementException extends FormException { ContactRequirementException(String msg) { diff --git a/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTest.java b/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTest.java index 64168200a..7133b2940 100644 --- a/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTest.java +++ b/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTest.java @@ -27,11 +27,9 @@ import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableMap; import google.registry.export.sheet.SyncRegistrarsSheetAction; import google.registry.model.registrar.Registrar; -import google.registry.testing.ExceptionRule; import google.registry.testing.TaskQueueHelper.TaskMatcher; import java.util.Map; import javax.mail.internet.InternetAddress; -import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; @@ -40,9 +38,6 @@ import org.mockito.runners.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase { - @Rule - public final ExceptionRule thrown = new ExceptionRule(); - @Test public void testSuccess_updateRegistrarInfo_andSendsNotificationEmail() throws Exception { String expectedEmailBody = readResourceUtf8(getClass(), "testdata/update_registrar_email.txt"); diff --git a/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTestCase.java b/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTestCase.java index d1144cf22..b0c630541 100644 --- a/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTestCase.java +++ b/javatests/google/registry/ui/server/registrar/RegistrarSettingsActionTestCase.java @@ -32,7 +32,6 @@ import google.registry.request.JsonActionRunner; import google.registry.request.JsonResponse; import google.registry.request.ResponseImpl; import google.registry.testing.AppEngineRule; -import google.registry.testing.ExceptionRule; import google.registry.testing.FakeClock; import google.registry.testing.InjectRule; import google.registry.util.SendEmailService; @@ -70,9 +69,6 @@ public class RegistrarSettingsActionTestCase { @Rule public final InjectRule inject = new InjectRule(); - @Rule - public final ExceptionRule thrown = new ExceptionRule(); - @Mock HttpServletRequest req; @@ -123,7 +119,9 @@ public class RegistrarSettingsActionTestCase { protected Map readJsonFromFile(String filename) { String contents = readResourceUtf8(getClass(), filename); try { - return (Map) JSONValue.parseWithException(contents); + @SuppressWarnings("unchecked") + Map json = (Map) JSONValue.parseWithException(contents); + return json; } catch (ParseException ex) { throw new RuntimeException(ex); }