From 9ee92294567534ef3a5ed0e100e69f43d2475069 Mon Sep 17 00:00:00 2001 From: nickfelt Date: Mon, 22 May 2017 09:37:42 -0700 Subject: [PATCH] Fix message for SuperordinateDomainInPendingDeleteException The StatusProhibitsOperationException superclass constructor just wants a raw message to return to the client, so we should pass it an explanation rather than just the superordinate domain name. In fact, I think the superordinate domain name isn't really necessary since it should be obvious from the hostname in the create/update request what the superordinate domain would be. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=156747185 --- java/google/registry/flows/host/HostFlowUtils.java | 7 +++---- .../google/registry/flows/host/HostCreateFlowTest.java | 2 +- .../google/registry/flows/host/HostUpdateFlowTest.java | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/java/google/registry/flows/host/HostFlowUtils.java b/java/google/registry/flows/host/HostFlowUtils.java index 1a8e5c9a4..b6cd975e1 100644 --- a/java/google/registry/flows/host/HostFlowUtils.java +++ b/java/google/registry/flows/host/HostFlowUtils.java @@ -134,16 +134,15 @@ public class HostFlowUtils { DomainResource superordinateDomain) throws EppException { if ((superordinateDomain != null) && superordinateDomain.getStatusValues().contains(StatusValue.PENDING_DELETE)) { - throw new SuperordinateDomainInPendingDeleteException( - superordinateDomain.getFullyQualifiedDomainName()); + throw new SuperordinateDomainInPendingDeleteException(); } } /** Superordinate domain for this hostname is in pending delete. */ static class SuperordinateDomainInPendingDeleteException extends StatusProhibitsOperationException { - public SuperordinateDomainInPendingDeleteException(String domainName) { - super(domainName); + public SuperordinateDomainInPendingDeleteException() { + super("Superordinate domain for this hostname is in pending delete"); } } diff --git a/javatests/google/registry/flows/host/HostCreateFlowTest.java b/javatests/google/registry/flows/host/HostCreateFlowTest.java index f63134294..c187182bb 100644 --- a/javatests/google/registry/flows/host/HostCreateFlowTest.java +++ b/javatests/google/registry/flows/host/HostCreateFlowTest.java @@ -184,7 +184,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase