mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Unify two exceptions that mean the same thing
These were historically separate due to the old flow structure, but now they should be one exception. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133984858
This commit is contained in:
parent
21a98b899c
commit
096877f03e
55 changed files with 163 additions and 211 deletions
|
@ -31,14 +31,13 @@ import com.googlecode.objectify.Key;
|
|||
import com.googlecode.objectify.Work;
|
||||
import google.registry.flows.EppException.AuthorizationErrorException;
|
||||
import google.registry.flows.EppException.InvalidAuthorizationInformationErrorException;
|
||||
import google.registry.flows.EppException.ObjectDoesNotExistException;
|
||||
import google.registry.flows.exceptions.MissingTransferRequestAuthInfoException;
|
||||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.flows.exceptions.NotTransferInitiatorException;
|
||||
import google.registry.flows.exceptions.ResourceAlreadyExistsException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.exceptions.ResourceToDeleteIsReferencedException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.flows.exceptions.TooManyResourceChecksException;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.EppResource.Builder;
|
||||
|
@ -201,7 +200,7 @@ public class ResourceFlowUtils {
|
|||
public EppException run() {
|
||||
final ForeignKeyIndex<R> fki = ForeignKeyIndex.load(resourceClass, targetId, now);
|
||||
if (fki == null) {
|
||||
return new ResourceToMutateDoesNotExistException(resourceClass, targetId);
|
||||
return new ResourceDoesNotExistException(resourceClass, targetId);
|
||||
}
|
||||
// Query for the first few linked domains, and if found, actually load them. The query is
|
||||
// eventually consistent and so might be very stale, but the direct load will not be stale,
|
||||
|
@ -285,20 +284,16 @@ public class ResourceFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static <R extends EppResource> R loadResourceForQuery(
|
||||
Class<R> clazz, String targetId, DateTime now) throws ResourceToQueryDoesNotExistException {
|
||||
R resource = loadByForeignKey(clazz, targetId, now);
|
||||
if (resource == null) {
|
||||
throw new ResourceToQueryDoesNotExistException(clazz, targetId);
|
||||
}
|
||||
return resource;
|
||||
public static <R extends EppResource & ForeignKeyedEppResource> R loadAndVerifyExistence(
|
||||
Class<R> clazz, String targetId, DateTime now)
|
||||
throws ResourceDoesNotExistException {
|
||||
return verifyExistence(clazz, targetId, loadByForeignKey(clazz, targetId, now));
|
||||
}
|
||||
|
||||
public static <R extends EppResource> R loadResourceToMutate(
|
||||
Class<R> clazz, String targetId, DateTime now) throws ResourceToMutateDoesNotExistException {
|
||||
R resource = loadByForeignKey(clazz, targetId, now);
|
||||
public static <R extends EppResource> R verifyExistence(
|
||||
Class<R> clazz, String targetId, R resource) throws ResourceDoesNotExistException {
|
||||
if (resource == null) {
|
||||
throw new ResourceToMutateDoesNotExistException(clazz, targetId);
|
||||
throw new ResourceDoesNotExistException(clazz, targetId);
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
|
@ -361,6 +356,13 @@ public class ResourceFlowUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/** Resource with this id does not exist. */
|
||||
public static class ResourceDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public ResourceDoesNotExistException(Class<?> type, String targetId) {
|
||||
super(type, targetId);
|
||||
}
|
||||
}
|
||||
|
||||
/** The specified resource belongs to another client. */
|
||||
public static class ResourceNotOwnedException extends AuthorizationErrorException {
|
||||
public ResourceNotOwnedException() {
|
||||
|
|
|
@ -42,7 +42,7 @@ public abstract class ResourceMutateFlow<R extends EppResource, C extends Single
|
|||
@Override
|
||||
protected final void verifyIsAllowed() throws EppException {
|
||||
if (existingResource == null) {
|
||||
throw new ResourceToMutateDoesNotExistException(
|
||||
throw new ResourceDoesNotExistException(
|
||||
new TypeInstantiator<R>(getClass()){}.getExactType(), targetId);
|
||||
}
|
||||
if (command.getAuthInfo() != null) {
|
||||
|
@ -56,8 +56,8 @@ public abstract class ResourceMutateFlow<R extends EppResource, C extends Single
|
|||
protected void verifyMutationAllowed() throws EppException {}
|
||||
|
||||
/** Resource with this id does not exist. */
|
||||
public static class ResourceToMutateDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public ResourceToMutateDoesNotExistException(Class<?> type, String targetId) {
|
||||
public static class ResourceDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public ResourceDoesNotExistException(Class<?> type, String targetId) {
|
||||
super(type, targetId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public abstract class ResourceQueryFlow<R extends EppResource, C extends SingleR
|
|||
@Override
|
||||
protected final void verifyIsAllowed() throws EppException {
|
||||
if (existingResource == null) {
|
||||
throw new ResourceToQueryDoesNotExistException(
|
||||
throw new ResourceDoesNotExistException(
|
||||
new TypeInstantiator<R>(getClass()){}.getExactType(), targetId);
|
||||
}
|
||||
if (command.getAuthInfo() != null) {
|
||||
|
@ -47,8 +47,8 @@ public abstract class ResourceQueryFlow<R extends EppResource, C extends SingleR
|
|||
protected void verifyQueryIsAllowed() throws EppException {}
|
||||
|
||||
/** Resource with this id does not exist. */
|
||||
public static class ResourceToQueryDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public ResourceToQueryDoesNotExistException(Class<?> type, String targetId) {
|
||||
public static class ResourceDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public ResourceDoesNotExistException(Class<?> type, String targetId) {
|
||||
super(type, targetId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.failfastForAsyncDelete;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyNoDisallowedStatuses;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
|
@ -53,10 +53,10 @@ import org.joda.time.Duration;
|
|||
* references to the host before the deletion is allowed to proceed. A poll message will be written
|
||||
* with the success or failure message when the process is complete.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToDeleteIsReferencedException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
*/
|
||||
public final class ContactDeleteFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
||||
|
@ -89,7 +89,7 @@ public final class ContactDeleteFlow extends LoggedInFlow implements Transaction
|
|||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
failfastForAsyncDelete(targetId, now, ContactResource.class, GET_REFERENCED_CONTACTS);
|
||||
ContactResource existingContact = loadResourceToMutate(ContactResource.class, targetId, now);
|
||||
ContactResource existingContact = loadAndVerifyExistence(ContactResource.class, targetId, now);
|
||||
verifyNoDisallowedStatuses(existingContact, DISALLOWED_STATUSES);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingContact);
|
||||
if (!isSuperuser) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceForQuery;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.model.EppResourceUtils.cloneResourceWithLinkedStatus;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||
|
@ -37,7 +37,7 @@ import javax.inject.Inject;
|
|||
* ever been transferred. Any registrar can see any contact's information, but the authInfo is only
|
||||
* visible to the registrar that owns the contact or to a registrar that already supplied it.
|
||||
*
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToQueryDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
*/
|
||||
public final class ContactInfoFlow extends LoggedInFlow {
|
||||
|
||||
|
@ -48,7 +48,7 @@ public final class ContactInfoFlow extends LoggedInFlow {
|
|||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
ContactResource contact = loadResourceForQuery(ContactResource.class, targetId, now);
|
||||
ContactResource contact = loadAndVerifyExistence(ContactResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, contact);
|
||||
if (!clientId.equals(contact.getCurrentSponsorClientId()) && !authInfo.isPresent()) {
|
||||
contact = contact.asBuilder().setAuthInfo(null).build();
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.approvePendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
import static google.registry.flows.contact.ContactFlowUtils.createGainingTransferPollMessage;
|
||||
|
@ -53,8 +53,8 @@ import javax.inject.Inject;
|
|||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
*/
|
||||
public final class ContactTransferApproveFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
||||
|
@ -76,7 +76,7 @@ public final class ContactTransferApproveFlow extends LoggedInFlow implements Tr
|
|||
*/
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
ContactResource existingContact = loadResourceToMutate(ContactResource.class, targetId, now);
|
||||
ContactResource existingContact = loadAndVerifyExistence(ContactResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingContact);
|
||||
TransferData transferData = existingContact.getTransferData();
|
||||
if (transferData.getTransferStatus() != TransferStatus.PENDING) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.denyPendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.contact.ContactFlowUtils.createLosingTransferPollMessage;
|
||||
import static google.registry.flows.contact.ContactFlowUtils.createTransferResponse;
|
||||
|
@ -52,9 +52,9 @@ import javax.inject.Inject;
|
|||
* withdraw the transfer request.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.NotTransferInitiatorException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
*/
|
||||
public final class ContactTransferCancelFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
||||
|
@ -72,7 +72,7 @@ public final class ContactTransferCancelFlow extends LoggedInFlow implements Tra
|
|||
|
||||
@Override
|
||||
protected final EppOutput run() throws EppException {
|
||||
ContactResource existingContact = loadResourceToMutate(ContactResource.class, targetId, now);
|
||||
ContactResource existingContact = loadAndVerifyExistence(ContactResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingContact);
|
||||
TransferData transferData = existingContact.getTransferData();
|
||||
if (transferData.getTransferStatus() != TransferStatus.PENDING) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceForQuery;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.contact.ContactFlowUtils.createTransferResponse;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||
|
@ -42,9 +42,9 @@ import javax.inject.Inject;
|
|||
* period expiring.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.NoTransferHistoryToQueryException}
|
||||
* @error {@link google.registry.flows.exceptions.NotAuthorizedToViewTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToQueryDoesNotExistException}
|
||||
*/
|
||||
public final class ContactTransferQueryFlow extends LoggedInFlow {
|
||||
|
||||
|
@ -55,7 +55,7 @@ public final class ContactTransferQueryFlow extends LoggedInFlow {
|
|||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
ContactResource contact = loadResourceForQuery(ContactResource.class, targetId, now);
|
||||
ContactResource contact = loadAndVerifyExistence(ContactResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, contact);
|
||||
// Most of the fields on the transfer response are required, so there's no way to return valid
|
||||
// XML if the object has never been transferred (and hence the fields aren't populated).
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.denyPendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
import static google.registry.flows.contact.ContactFlowUtils.createGainingTransferPollMessage;
|
||||
|
@ -50,9 +50,9 @@ import javax.inject.Inject;
|
|||
* reject the transfer request.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
*/
|
||||
public final class ContactTransferRejectFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
||||
|
@ -69,7 +69,7 @@ public final class ContactTransferRejectFlow extends LoggedInFlow implements Tra
|
|||
|
||||
@Override
|
||||
protected final EppOutput run() throws EppException {
|
||||
ContactResource existingContact = loadResourceToMutate(ContactResource.class, targetId, now);
|
||||
ContactResource existingContact = loadAndVerifyExistence(ContactResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingContact);
|
||||
TransferData transferData = existingContact.getTransferData();
|
||||
if (transferData.getTransferStatus() != TransferStatus.PENDING) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyNoDisallowedStatuses;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyRequiredAuthInfoForResourceTransfer;
|
||||
import static google.registry.flows.contact.ContactFlowUtils.createGainingTransferPollMessage;
|
||||
|
@ -58,7 +58,7 @@ import org.joda.time.Duration;
|
|||
* request.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.AlreadyPendingTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.MissingTransferRequestAuthInfoException}
|
||||
* @error {@link google.registry.flows.exceptions.ObjectAlreadySponsoredException}
|
||||
|
@ -84,7 +84,7 @@ public final class ContactTransferRequestFlow extends LoggedInFlow implements Tr
|
|||
|
||||
@Override
|
||||
protected final EppOutput run() throws EppException {
|
||||
ContactResource existingContact = loadResourceToMutate(ContactResource.class, targetId, now);
|
||||
ContactResource existingContact = loadAndVerifyExistence(ContactResource.class, targetId, now);
|
||||
verifyRequiredAuthInfoForResourceTransfer(authInfo, existingContact);
|
||||
// Verify that the resource does not already have a pending transfer.
|
||||
if (TransferStatus.PENDING.equals(existingContact.getTransferData().getTransferStatus())) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.flows.contact;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyNoDisallowedStatuses;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
|
@ -50,11 +50,11 @@ import javax.inject.Inject;
|
|||
/**
|
||||
* An EPP flow that updates a contact.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.AddRemoveSameValueEppException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.StatusNotClientSettableException}
|
||||
* @error {@link ContactFlowUtils.BadInternationalizedPostalInfoException}
|
||||
* @error {@link ContactFlowUtils.DeclineContactDisclosureFieldDisallowedPolicyException}
|
||||
|
@ -85,7 +85,7 @@ public final class ContactUpdateFlow extends LoggedInFlow implements Transaction
|
|||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
Update command = (Update) resourceCommand;
|
||||
ContactResource existingContact = loadResourceToMutate(ContactResource.class, targetId, now);
|
||||
ContactResource existingContact = loadAndVerifyExistence(ContactResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingContact);
|
||||
if (!isSuperuser) {
|
||||
verifyResourceOwnership(clientId, existingContact);
|
||||
|
|
|
@ -42,7 +42,7 @@ import javax.inject.Inject;
|
|||
* @error {@link google.registry.flows.ResourceFlow.BadCommandForRegistryPhaseException}
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException}
|
||||
* @error {@link DomainApplicationDeleteFlow.SunriseApplicationCannotBeDeletedInLandrushException}
|
||||
* @error {@link DomainFlowUtils.ApplicationDomainNameMismatchException}
|
||||
* @error {@link DomainFlowUtils.LaunchPhaseMismatchException}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import static google.registry.flows.EppXmlTransformer.unmarshal;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.addSecDnsExtensionIfPresent;
|
||||
|
@ -31,7 +32,6 @@ import google.registry.flows.FlowModule.ApplicationId;
|
|||
import google.registry.flows.FlowModule.ClientId;
|
||||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.LoggedInFlow;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainCommand.Info;
|
||||
import google.registry.model.domain.launch.LaunchInfoExtension;
|
||||
|
@ -51,8 +51,8 @@ import javax.inject.Inject;
|
|||
* <p>Only the registrar that owns the application can see its info. The flow can optionally include
|
||||
* delegated hosts in its response.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToQueryDoesNotExistException}
|
||||
* @error {@link DomainFlowUtils.ApplicationDomainNameMismatchException}
|
||||
* @error {@link DomainApplicationInfoFlow.ApplicationLaunchPhaseMismatchException}
|
||||
* @error {@link MissingApplicationIdException}
|
||||
|
@ -76,10 +76,8 @@ public final class DomainApplicationInfoFlow extends LoggedInFlow {
|
|||
if (applicationId.isEmpty()) {
|
||||
throw new MissingApplicationIdException();
|
||||
}
|
||||
DomainApplication application = loadDomainApplication(applicationId, now);
|
||||
if (application == null) {
|
||||
throw new ResourceToQueryDoesNotExistException(DomainApplication.class, applicationId);
|
||||
}
|
||||
DomainApplication application = verifyExistence(
|
||||
DomainApplication.class, applicationId, loadDomainApplication(applicationId, now));
|
||||
verifyApplicationDomainMatchesTargetId(application, targetId);
|
||||
verifyOptionalAuthInfoForResource(authInfo, application);
|
||||
LaunchInfoExtension launchInfo = eppInput.getSingleExtension(LaunchInfoExtension.class);
|
||||
|
|
|
@ -36,7 +36,7 @@ import javax.inject.Inject;
|
|||
* @error {@link google.registry.flows.EppException.UnimplementedExtensionException}
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceUpdateFlow.AddRemoveSameValueEppException}
|
||||
* @error {@link google.registry.flows.ResourceUpdateFlow.ResourceHasClientUpdateProhibitedException}
|
||||
* @error {@link google.registry.flows.ResourceUpdateFlow.StatusNotClientSettableException}
|
||||
|
|
|
@ -66,7 +66,7 @@ import org.joda.time.DateTime;
|
|||
* @error {@link google.registry.flows.ResourceCreateOrMutateFlow.OnlyToolCanPassMetadataException}
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.SingleResourceFlow.ResourceStatusProhibitsOperationException}
|
||||
* @error {@link DomainDeleteFlow.DomainToDeleteHasHostsException}
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.flows.domain;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceForQuery;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.addSecDnsExtensionIfPresent;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.handleFeeRequest;
|
||||
|
@ -53,7 +53,7 @@ import javax.inject.Inject;
|
|||
* answered with a minimal result containing only basic information about the domain.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToQueryDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link DomainFlowUtils.BadPeriodUnitException}
|
||||
* @error {@link DomainFlowUtils.CurrencyUnitMismatchException}
|
||||
* @error {@link DomainFlowUtils.FeeChecksDontSupportPhasesException}
|
||||
|
@ -74,7 +74,7 @@ public final class DomainInfoFlow extends LoggedInFlow {
|
|||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
DomainResource domain = loadResourceForQuery(DomainResource.class, targetId, now);
|
||||
DomainResource domain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, domain);
|
||||
return createOutput(
|
||||
SUCCESS,
|
||||
|
|
|
@ -63,7 +63,7 @@ import org.joda.time.DateTime;
|
|||
*
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.SingleResourceFlow.ResourceStatusProhibitsOperationException}
|
||||
* @error {@link DomainFlowUtils.BadPeriodUnitException}
|
||||
* @error {@link DomainFlowUtils.CurrencyUnitMismatchException}
|
||||
|
|
|
@ -60,7 +60,7 @@ import org.joda.time.DateTime;
|
|||
* @error {@link google.registry.flows.EppException.UnimplementedExtensionException}
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException}
|
||||
* @error {@link DomainFlowUtils.CurrencyUnitMismatchException}
|
||||
* @error {@link DomainFlowUtils.CurrencyValueScaleException}
|
||||
* @error {@link DomainFlowUtils.DomainReservedException}
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.flows.domain;
|
|||
import static com.google.common.collect.Iterables.filter;
|
||||
import static com.google.common.collect.Iterables.getOnlyElement;
|
||||
import static google.registry.flows.ResourceFlowUtils.approvePendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyHasPendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
|
@ -71,9 +71,9 @@ import org.joda.time.DateTime;
|
|||
* those speculative objects are deleted and replaced with new ones with the correct approval time.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
*/
|
||||
public final class DomainTransferApproveFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
@ -95,7 +95,7 @@ public final class DomainTransferApproveFlow extends LoggedInFlow implements Tra
|
|||
*/
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
DomainResource existingDomain = loadResourceToMutate(DomainResource.class, targetId, now);
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingDomain);
|
||||
verifyHasPendingTransfer(existingDomain);
|
||||
verifyResourceOwnership(clientId, existingDomain);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.denyPendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyHasPendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyIsGainingRegistrar;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
|
@ -56,9 +56,9 @@ import javax.inject.Inject;
|
|||
* those speculative objects are deleted.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.NotTransferInitiatorException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
*/
|
||||
public final class DomainTransferCancelFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
@ -76,7 +76,7 @@ public final class DomainTransferCancelFlow extends LoggedInFlow implements Tran
|
|||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
DomainResource existingDomain = loadResourceToMutate(DomainResource.class, targetId, now);
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingDomain);
|
||||
verifyHasPendingTransfer(existingDomain);
|
||||
verifyIsGainingRegistrar(existingDomain, clientId);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.flows.domain;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceForQuery;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.createTransferResponse;
|
||||
import static google.registry.model.domain.DomainResource.extendRegistrationWithCap;
|
||||
|
@ -46,9 +46,9 @@ import org.joda.time.DateTime;
|
|||
* period expiring.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.NoTransferHistoryToQueryException}
|
||||
* @error {@link google.registry.flows.exceptions.NotAuthorizedToViewTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToQueryDoesNotExistException}
|
||||
*/
|
||||
public final class DomainTransferQueryFlow extends LoggedInFlow {
|
||||
|
||||
|
@ -59,7 +59,7 @@ public final class DomainTransferQueryFlow extends LoggedInFlow {
|
|||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
DomainResource domain = loadResourceForQuery(DomainResource.class, targetId, now);
|
||||
DomainResource domain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, domain);
|
||||
// Most of the fields on the transfer response are required, so there's no way to return valid
|
||||
// XML if the object has never been transferred (and hence the fields aren't populated).
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.denyPendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyHasPendingTransfer;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
|
@ -56,9 +56,9 @@ import javax.inject.Inject;
|
|||
* those speculative objects are deleted.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||
*/
|
||||
public final class DomainTransferRejectFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
@ -76,7 +76,7 @@ public final class DomainTransferRejectFlow extends LoggedInFlow implements Tran
|
|||
|
||||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
DomainResource existingDomain = loadResourceToMutate(DomainResource.class, targetId, now);
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
HistoryEntry historyEntry = historyBuilder
|
||||
.setType(HistoryEntry.Type.DOMAIN_TRANSFER_REJECT)
|
||||
.setModificationTime(now)
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.flows.domain;
|
|||
import static com.google.common.collect.Iterables.filter;
|
||||
import static com.google.common.collect.Iterables.getOnlyElement;
|
||||
import static com.google.common.collect.Sets.union;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyNoDisallowedStatuses;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyRequiredAuthInfoForResourceTransfer;
|
||||
import static google.registry.flows.domain.DomainFlowUtils.checkAllowedAccessToTld;
|
||||
|
@ -91,11 +91,11 @@ import org.joda.time.DateTime;
|
|||
* replaced with new ones with the correct approval time).
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.AlreadyPendingTransferException}
|
||||
* @error {@link google.registry.flows.exceptions.MissingTransferRequestAuthInfoException}
|
||||
* @error {@link google.registry.flows.exceptions.ObjectAlreadySponsoredException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link DomainFlowUtils.BadPeriodUnitException}
|
||||
* @error {@link DomainFlowUtils.CurrencyUnitMismatchException}
|
||||
* @error {@link DomainFlowUtils.CurrencyValueScaleException}
|
||||
|
@ -129,7 +129,7 @@ public final class DomainTransferRequestFlow extends LoggedInFlow implements Tra
|
|||
public final EppOutput run() throws EppException {
|
||||
Period period = ((Transfer) resourceCommand).getPeriod();
|
||||
int years = period.getValue();
|
||||
DomainResource existingDomain = loadResourceToMutate(DomainResource.class, targetId, now);
|
||||
DomainResource existingDomain = loadAndVerifyExistence(DomainResource.class, targetId, now);
|
||||
verifyTransferAllowed(existingDomain, period);
|
||||
String tld = existingDomain.getTld();
|
||||
Registry registry = Registry.get(tld);
|
||||
|
|
|
@ -48,7 +48,7 @@ import org.joda.time.DateTime;
|
|||
* @error {@link google.registry.flows.ResourceCreateOrMutateFlow.OnlyToolCanPassMetadataException}
|
||||
* @error {@link google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceUpdateFlow.AddRemoveSameValueEppException}
|
||||
* @error {@link google.registry.flows.ResourceUpdateFlow.ResourceHasClientUpdateProhibitedException}
|
||||
* @error {@link google.registry.flows.ResourceUpdateFlow.StatusNotClientSettableException}
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.google.common.base.Optional;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.DomainCommand.Create;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
|
@ -183,7 +183,7 @@ public final class TldSpecificLogicProxy {
|
|||
// TODO: Consider changing the method definition to have the domain passed in to begin with.
|
||||
DomainResource domain = loadByForeignKey(DomainResource.class, domainName, date);
|
||||
if (domain == null) {
|
||||
throw new ResourceToMutateDoesNotExistException(DomainResource.class, domainName);
|
||||
throw new ResourceDoesNotExistException(DomainResource.class, domainName);
|
||||
}
|
||||
return
|
||||
extraFlowLogic.get().getRenewFeeOrCredit(domain, clientId, date, years, eppInput);
|
||||
|
@ -249,7 +249,7 @@ public final class TldSpecificLogicProxy {
|
|||
// TODO: Consider changing the method definition to have the domain passed in to begin with.
|
||||
DomainResource domain = loadByForeignKey(DomainResource.class, domainName, date);
|
||||
if (domain == null) {
|
||||
throw new ResourceToMutateDoesNotExistException(DomainResource.class, domainName);
|
||||
throw new ResourceDoesNotExistException(DomainResource.class, domainName);
|
||||
}
|
||||
feeOrCredit =
|
||||
extraFlowLogic.get().getUpdateFeeOrCredit(domain, clientId, date, eppInput);
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.flows.exceptions;
|
||||
|
||||
import google.registry.flows.EppException.ObjectDoesNotExistException;
|
||||
|
||||
/** Resource with this id does not exist. */
|
||||
public class ResourceToMutateDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public ResourceToMutateDoesNotExistException(Class<?> type, String targetId) {
|
||||
super(type, targetId);
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.flows.exceptions;
|
||||
|
||||
import google.registry.flows.EppException.ObjectDoesNotExistException;
|
||||
|
||||
/** Resource with this id does not exist. */
|
||||
public class ResourceToQueryDoesNotExistException extends ObjectDoesNotExistException {
|
||||
public ResourceToQueryDoesNotExistException(Class<?> type, String targetId) {
|
||||
super(type, targetId);
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.flows.host;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.failfastForAsyncDelete;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyNoDisallowedStatuses;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
|
@ -50,9 +50,9 @@ import javax.inject.Inject;
|
|||
* references to the host before the deletion is allowed to proceed. A poll message will be written
|
||||
* with the success or failure message when the process is complete.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToDeleteIsReferencedException}
|
||||
*/
|
||||
public final class HostDeleteFlow extends LoggedInFlow implements TransactionalFlow {
|
||||
|
@ -85,7 +85,7 @@ public final class HostDeleteFlow extends LoggedInFlow implements TransactionalF
|
|||
@Override
|
||||
public final EppOutput run() throws EppException {
|
||||
failfastForAsyncDelete(targetId, now, HostResource.class, GET_NAMESERVERS);
|
||||
HostResource existingHost = loadResourceToMutate(HostResource.class, targetId, now);
|
||||
HostResource existingHost = loadAndVerifyExistence(HostResource.class, targetId, now);
|
||||
verifyNoDisallowedStatuses(existingHost, DISALLOWED_STATUSES);
|
||||
verifyOptionalAuthInfoForResource(authInfo, existingHost);
|
||||
if (!isSuperuser) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
package google.registry.flows.host;
|
||||
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceForQuery;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.model.EppResourceUtils.cloneResourceWithLinkedStatus;
|
||||
import static google.registry.model.eppoutput.Result.Code.SUCCESS;
|
||||
|
@ -34,7 +34,7 @@ import javax.inject.Inject;
|
|||
* <p>The returned information included IP addresses, if any, and details of the host's most recent
|
||||
* transfer if it has ever been transferred. Any registrar can see the information for any host.
|
||||
*
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToQueryDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
*/
|
||||
public final class HostInfoFlow extends LoggedInFlow {
|
||||
|
||||
|
@ -44,7 +44,7 @@ public final class HostInfoFlow extends LoggedInFlow {
|
|||
|
||||
@Override
|
||||
public EppOutput run() throws EppException {
|
||||
HostResource host = loadResourceForQuery(HostResource.class, targetId, now);
|
||||
HostResource host = loadAndVerifyExistence(HostResource.class, targetId, now);
|
||||
verifyOptionalAuthInfoForResource(authInfo, host);
|
||||
return createOutput(SUCCESS, cloneResourceWithLinkedStatus(host, now));
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.flows.host;
|
||||
|
||||
import static com.google.common.base.MoreObjects.firstNonNull;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadResourceToMutate;
|
||||
import static google.registry.flows.ResourceFlowUtils.loadAndVerifyExistence;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyNoDisallowedStatuses;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyOptionalAuthInfoForResource;
|
||||
import static google.registry.flows.ResourceFlowUtils.verifyResourceOwnership;
|
||||
|
@ -74,10 +74,10 @@ import javax.inject.Inject;
|
|||
* when it is renamed from external to internal at least one must be added. If the host is renamed
|
||||
* or IP addresses are added, tasks are enqueued to update DNS accordingly.
|
||||
*
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException}
|
||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
|
||||
* @error {@link google.registry.flows.exceptions.ResourceToMutateDoesNotExistException}
|
||||
* @error {@link google.registry.flows.exceptions.StatusNotClientSettableException}
|
||||
* @error {@link HostFlowUtils.HostNameTooShallowException}
|
||||
* @error {@link HostFlowUtils.InvalidHostNameException}
|
||||
|
@ -116,7 +116,7 @@ public final class HostUpdateFlow extends LoggedInFlow implements TransactionalF
|
|||
public final EppOutput run() throws EppException {
|
||||
Update command = (Update) resourceCommand;
|
||||
String suppliedNewHostName = command.getInnerChange().getFullyQualifiedHostName();
|
||||
HostResource existingHost = loadResourceToMutate(HostResource.class, targetId, now);
|
||||
HostResource existingHost = loadAndVerifyExistence(HostResource.class, targetId, now);
|
||||
boolean isHostRename = suppliedNewHostName != null;
|
||||
String oldHostName = targetId;
|
||||
String newHostName = firstNonNull(suppliedNewHostName, oldHostName);
|
||||
|
|
|
@ -25,10 +25,10 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.exceptions.ResourceToDeleteIsReferencedException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
@ -78,7 +78,7 @@ public class ContactDeleteFlowTest
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class ContactDeleteFlowTest
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistDeletedContact(getUniqueIdFromCommand(), clock.nowUtc());
|
||||
runFlow();
|
||||
|
|
|
@ -24,7 +24,7 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAddress;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.contact.ContactPhoneNumber;
|
||||
|
@ -164,7 +164,7 @@ public class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, C
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ public class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, C
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistContactResource(false);
|
||||
runFlow();
|
||||
|
|
|
@ -26,9 +26,9 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import com.google.common.collect.FluentIterable;
|
||||
import com.google.common.collect.Iterables;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -192,7 +192,7 @@ public class ContactTransferApproveFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
contact = persistResource(
|
||||
contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -202,7 +202,7 @@ public class ContactTransferApproveFlowTest
|
|||
@Test
|
||||
public void testFailure_nonexistentContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(contact);
|
||||
contact = persistResource(
|
||||
|
|
|
@ -25,9 +25,9 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import com.google.common.collect.FluentIterable;
|
||||
import com.google.common.collect.Iterables;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.flows.exceptions.NotTransferInitiatorException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -180,7 +180,7 @@ public class ContactTransferCancelFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
contact = persistResource(
|
||||
contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -190,7 +190,7 @@ public class ContactTransferCancelFlowTest
|
|||
@Test
|
||||
public void testFailure_nonexistentContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(contact);
|
||||
doFailingTest("contact_transfer_cancel.xml");
|
||||
|
|
|
@ -20,9 +20,9 @@ import static google.registry.testing.DatastoreHelper.deleteResource;
|
|||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
||||
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -168,7 +168,7 @@ public class ContactTransferQueryFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
contact = persistResource(
|
||||
contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -178,7 +178,7 @@ public class ContactTransferQueryFlowTest
|
|||
@Test
|
||||
public void testFailure_nonexistentContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(contact);
|
||||
doFailingTest("contact_transfer_query.xml");
|
||||
|
|
|
@ -25,9 +25,9 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import com.google.common.collect.FluentIterable;
|
||||
import com.google.common.collect.Iterables;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -190,7 +190,7 @@ public class ContactTransferRejectFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
contact = persistResource(
|
||||
contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -200,7 +200,7 @@ public class ContactTransferRejectFlowTest
|
|||
@Test
|
||||
public void testFailure_nonexistentContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(contact);
|
||||
doFailingTest("contact_transfer_reject.xml");
|
||||
|
|
|
@ -24,10 +24,10 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
|
||||
import google.registry.config.RegistryEnvironment;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.exceptions.AlreadyPendingTransferException;
|
||||
import google.registry.flows.exceptions.MissingTransferRequestAuthInfoException;
|
||||
import google.registry.flows.exceptions.ObjectAlreadySponsoredException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -173,7 +173,7 @@ public class ContactTransferRequestFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
contact = persistResource(
|
||||
contact.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -183,7 +183,7 @@ public class ContactTransferRequestFlowTest
|
|||
@Test
|
||||
public void testFailure_nonexistentContact() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(contact);
|
||||
doFailingTest("contact_transfer_request.xml");
|
||||
|
|
|
@ -24,13 +24,13 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.contact.ContactFlowUtils.BadInternationalizedPostalInfoException;
|
||||
import google.registry.flows.contact.ContactFlowUtils.DeclineContactDisclosureFieldDisallowedPolicyException;
|
||||
import google.registry.flows.exceptions.AddRemoveSameValueEppException;
|
||||
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.exceptions.StatusNotClientSettableException;
|
||||
import google.registry.model.contact.ContactAddress;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
|
@ -151,7 +151,7 @@ public class ContactUpdateFlowTest
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class ContactUpdateFlowTest
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistDeletedContact(getUniqueIdFromCommand(), clock.nowUtc());
|
||||
runFlow();
|
||||
|
|
|
@ -31,7 +31,7 @@ import google.registry.flows.EppException.UnimplementedExtensionException;
|
|||
import google.registry.flows.ResourceFlow.BadCommandForRegistryPhaseException;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException;
|
||||
import google.registry.flows.domain.DomainApplicationDeleteFlow.SunriseApplicationCannotBeDeletedInLandrushException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.ApplicationDomainNameMismatchException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.LaunchPhaseMismatchException;
|
||||
|
@ -120,7 +120,7 @@ public class DomainApplicationDeleteFlowTest
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public class DomainApplicationDeleteFlowTest
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistResource(newDomainApplication("example.tld").asBuilder()
|
||||
.setRepoId("1-TLD")
|
||||
|
|
|
@ -27,11 +27,11 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.domain.DomainApplicationInfoFlow.ApplicationLaunchPhaseMismatchException;
|
||||
import google.registry.flows.domain.DomainApplicationInfoFlow.MissingApplicationIdException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.ApplicationDomainNameMismatchException;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
|
@ -261,7 +261,7 @@ public class DomainApplicationInfoFlowTest
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ public class DomainApplicationInfoFlowTest
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistResource(new DomainApplication.Builder()
|
||||
.setRepoId("123-COM")
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.flows.EppException.UnimplementedExtensionException;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceUpdateFlow.AddRemoveSameValueEppException;
|
||||
import google.registry.flows.ResourceUpdateFlow.ResourceHasClientUpdateProhibitedException;
|
||||
import google.registry.flows.ResourceUpdateFlow.StatusNotClientSettableException;
|
||||
|
@ -402,7 +402,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistReferencedEntities();
|
||||
runFlow();
|
||||
|
@ -411,7 +411,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistReferencedEntities();
|
||||
persistResource(newApplicationBuilder().setDeletionTime(START_OF_TIME).build());
|
||||
|
|
|
@ -46,7 +46,7 @@ import google.registry.flows.EppRequestSource;
|
|||
import google.registry.flows.ResourceCreateOrMutateFlow.OnlyToolCanPassMetadataException;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException;
|
||||
import google.registry.flows.SingleResourceFlow.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.domain.DomainDeleteFlow.DomainToDeleteHasHostsException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
|
@ -593,7 +593,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistDeletedDomain(getUniqueIdFromCommand(), clock.nowUtc());
|
||||
runFlow();
|
||||
|
|
|
@ -29,11 +29,11 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadPeriodUnitException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.CurrencyUnitMismatchException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.FeeChecksDontSupportPhasesException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.RestoresAreAlwaysForOneYearException;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.model.billing.BillingEvent.Recurring;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
|
@ -375,7 +375,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistResource(newDomainResource("example.tld").asBuilder()
|
||||
.setDeletionTime(clock.nowUtc().minusDays(1))
|
||||
|
|
|
@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSortedMap;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException;
|
||||
import google.registry.flows.SingleResourceFlow.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadPeriodUnitException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.CurrencyUnitMismatchException;
|
||||
|
@ -380,7 +380,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -388,7 +388,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistDeletedDomain(getUniqueIdFromCommand(), clock.nowUtc());
|
||||
runFlow();
|
||||
|
|
|
@ -40,7 +40,7 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.flows.EppException.UnimplementedExtensionException;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.CurrencyUnitMismatchException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.CurrencyValueScaleException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.DomainReservedException;
|
||||
|
@ -343,7 +343,7 @@ public class DomainRestoreRequestFlowTest extends
|
|||
@Test
|
||||
public void testFailure_doesNotExist() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ public class DomainRestoreRequestFlowTest extends
|
|||
|
||||
@Test
|
||||
public void testFailure_fullyDeleted() throws Exception {
|
||||
thrown.expect(ResourceToMutateDoesNotExistException.class);
|
||||
thrown.expect(ResourceDoesNotExistException.class);
|
||||
persistDeletedDomain(getUniqueIdFromCommand(), clock.nowUtc());
|
||||
runFlow();
|
||||
}
|
||||
|
|
|
@ -39,10 +39,10 @@ import com.google.common.collect.ImmutableSortedMap;
|
|||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Ordering;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Cancellation;
|
||||
|
@ -456,7 +456,7 @@ public class DomainTransferApproveFlowTest
|
|||
|
||||
@Test
|
||||
public void testFailure_deletedDomain() throws Exception {
|
||||
thrown.expect(ResourceToMutateDoesNotExistException.class,
|
||||
thrown.expect(ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
domain = persistResource(
|
||||
domain.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -465,7 +465,7 @@ public class DomainTransferApproveFlowTest
|
|||
|
||||
@Test
|
||||
public void testFailure_nonexistentDomain() throws Exception {
|
||||
thrown.expect(ResourceToMutateDoesNotExistException.class,
|
||||
thrown.expect(ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(domain);
|
||||
doFailingTest("domain_transfer_approve.xml");
|
||||
|
|
|
@ -27,10 +27,10 @@ import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
|||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.flows.exceptions.NotTransferInitiatorException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
|
@ -270,7 +270,7 @@ public class DomainTransferCancelFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedDomain() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
domain = persistResource(
|
||||
domain.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -280,7 +280,7 @@ public class DomainTransferCancelFlowTest
|
|||
@Test
|
||||
public void testFailure_nonexistentDomain() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(domain);
|
||||
doFailingTest("domain_transfer_cancel.xml");
|
||||
|
|
|
@ -23,9 +23,9 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
||||
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
|
@ -225,7 +225,7 @@ public class DomainTransferQueryFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedDomain() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
domain = persistResource(
|
||||
domain.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -235,7 +235,7 @@ public class DomainTransferQueryFlowTest
|
|||
@Test
|
||||
public void testFailure_nonexistentDomain() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(domain);
|
||||
doFailingTest("domain_transfer_query.xml");
|
||||
|
|
|
@ -27,10 +27,10 @@ import com.google.common.collect.FluentIterable;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Iterables;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
|
@ -243,7 +243,7 @@ public class DomainTransferRejectFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedDomain() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
domain = persistResource(
|
||||
domain.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -253,7 +253,7 @@ public class DomainTransferRejectFlowTest
|
|||
@Test
|
||||
public void testFailure_nonexistentDomain() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(domain);
|
||||
doFailingTest("domain_transfer_reject.xml");
|
||||
|
|
|
@ -40,6 +40,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.BadPeriodUnitException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.CurrencyUnitMismatchException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.CurrencyValueScaleException;
|
||||
|
@ -52,7 +53,6 @@ import google.registry.flows.exceptions.AlreadyPendingTransferException;
|
|||
import google.registry.flows.exceptions.MissingTransferRequestAuthInfoException;
|
||||
import google.registry.flows.exceptions.ObjectAlreadySponsoredException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Cancellation.Builder;
|
||||
|
@ -725,7 +725,7 @@ public class DomainTransferRequestFlowTest
|
|||
@Test
|
||||
public void testFailure_deletedDomain() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
domain = persistResource(
|
||||
domain.asBuilder().setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
|
@ -737,14 +737,14 @@ public class DomainTransferRequestFlowTest
|
|||
setEppInput("domain_transfer_request_wildcard.xml", ImmutableMap.of("DOMAIN", "--invalid"));
|
||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||
assertTransactionalFlow(true);
|
||||
thrown.expect(ResourceToMutateDoesNotExistException.class, "(--invalid)");
|
||||
thrown.expect(ResourceDoesNotExistException.class, "(--invalid)");
|
||||
runFlow(CommitMode.LIVE, UserPrivileges.NORMAL);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonexistentDomain() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
deleteResource(domain);
|
||||
doFailingTest("domain_transfer_request.xml");
|
||||
|
|
|
@ -45,7 +45,7 @@ import google.registry.flows.EppRequestSource;
|
|||
import google.registry.flows.ResourceCreateOrMutateFlow.OnlyToolCanPassMetadataException;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceUpdateFlow.AddRemoveSameValueEppException;
|
||||
import google.registry.flows.ResourceUpdateFlow.ResourceHasClientUpdateProhibitedException;
|
||||
import google.registry.flows.ResourceUpdateFlow.StatusNotClientSettableException;
|
||||
|
@ -818,7 +818,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistReferencedEntities();
|
||||
runFlow();
|
||||
|
@ -827,7 +827,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistReferencedEntities();
|
||||
persistDeletedDomain(getUniqueIdFromCommand(), clock.nowUtc());
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Range;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceDoesNotExistException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.TestExtraLogicManager;
|
||||
|
@ -152,7 +152,7 @@ public class TldSpecificLogicProxyTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void test_extraLogic_renewPrice_noDomain() throws Exception {
|
||||
thrown.expect(ResourceToMutateDoesNotExistException.class);
|
||||
thrown.expect(ResourceDoesNotExistException.class);
|
||||
TldSpecificLogicProxy.getRenewPrice(
|
||||
Registry.get("test"), "renew--13.test", "clientId", clock.nowUtc(), 1, null);
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ public class TldSpecificLogicProxyTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void test_extraLogic_restorePrice_noDomain() throws Exception {
|
||||
thrown.expect(ResourceToMutateDoesNotExistException.class);
|
||||
thrown.expect(ResourceDoesNotExistException.class);
|
||||
TldSpecificLogicProxy.getRestorePrice(
|
||||
Registry.get("test"), "renew-13.test", "clientId", clock.nowUtc(), null);
|
||||
}
|
||||
|
|
|
@ -27,10 +27,10 @@ import static google.registry.testing.TaskQueueHelper.assertNoDnsTasksEnqueued;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.exceptions.ResourceToDeleteIsReferencedException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
@ -80,7 +80,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistDeletedHost(getUniqueIdFromCommand(), clock.nowUtc());
|
||||
runFlow();
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.net.InetAddresses;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.exceptions.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -145,7 +145,7 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToQueryDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
persistHostResource(false);
|
||||
runFlow();
|
||||
|
|
|
@ -41,11 +41,11 @@ import com.google.common.net.InetAddresses;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppRequestSource;
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.async.DnsRefreshForHostRenameAction;
|
||||
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
|
||||
import google.registry.flows.exceptions.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.exceptions.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.flows.exceptions.StatusNotClientSettableException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameTooShallowException;
|
||||
import google.registry.flows.host.HostFlowUtils.InvalidHostNameException;
|
||||
|
@ -659,7 +659,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
@Test
|
||||
public void testFailure_neverExisted() throws Exception {
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -668,7 +668,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
public void testFailure_neverExisted_updateWithoutNameChange() throws Exception {
|
||||
setEppInput("host_update_name_unchanged.xml");
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
persistDeletedHost(oldHostName(), clock.nowUtc());
|
||||
thrown.expect(
|
||||
ResourceToMutateDoesNotExistException.class,
|
||||
ResourceDoesNotExistException.class,
|
||||
String.format("(%s)", getUniqueIdFromCommand()));
|
||||
runFlow();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue