mirror of
https://github.com/google/nomulus.git
synced 2025-07-27 04:58:37 +02:00
Add a new MutatingFlow interface and make most flows use TransactionalFlow (#2129)
The old semantics for TransactionalFlow meant "anything that needs to mutate the database", but then FlowRunner was not creating transactions for non-transactional flows even though nearly every flow needs a transaction (as nearly every flow needs to hit the database for some purpose). So now TransactionalFlow simply means "any flow that needs the database", and MutatingFlow means "a flow that mutates the database". In the future we will have FlowRunner use a read-only transaction for TransactionalFlow and then a normal writes-allowed transaction for MutatingFlow. That is a TODO. This also fixes up some transact() calls inside caches to be reTransact(), as we rightly can't move the transaction outside them as from some callsites we legitimately do not know whether a transaction will be needed at all (depending on whether said data is already in memory). And it removes the replicaTm() calls which weren't actually doing anything as they were always nested inside of normal tm()s, thus causing confusion.
This commit is contained in:
parent
e6f9b1c7e6
commit
57592d787c
68 changed files with 218 additions and 211 deletions
|
@ -78,6 +78,8 @@ public class FlowRunner {
|
||||||
return EppOutput.create(flowProvider.get().run());
|
return EppOutput.create(flowProvider.get().run());
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
// TODO(mcilwain/weiminyu): Use transactReadOnly() here for TransactionalFlow and transact()
|
||||||
|
// for MutatingFlow.
|
||||||
return tm().transact(
|
return tm().transact(
|
||||||
() -> {
|
() -> {
|
||||||
try {
|
try {
|
||||||
|
|
23
core/src/main/java/google/registry/flows/MutatingFlow.java
Normal file
23
core/src/main/java/google/registry/flows/MutatingFlow.java
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
// Copyright 2023 The Nomulus 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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for a {@link TransactionalFlow} that mutates the database (i.e. is not read-only).
|
||||||
|
*
|
||||||
|
* <p>Any flow that mutates the DB should implement this so that {@link FlowRunner} will know how to
|
||||||
|
* run it.
|
||||||
|
*/
|
||||||
|
public interface MutatingFlow extends TransactionalFlow {}
|
|
@ -72,17 +72,12 @@ public final class ResourceFlowUtils {
|
||||||
*/
|
*/
|
||||||
public static <R extends EppResource> void checkLinkedDomains(
|
public static <R extends EppResource> void checkLinkedDomains(
|
||||||
final String targetId, final DateTime now, final Class<R> resourceClass) throws EppException {
|
final String targetId, final DateTime now, final Class<R> resourceClass) throws EppException {
|
||||||
EppException failfastException =
|
|
||||||
tm().transact(
|
|
||||||
() -> {
|
|
||||||
VKey<R> key = ForeignKeyUtils.load(resourceClass, targetId, now);
|
VKey<R> key = ForeignKeyUtils.load(resourceClass, targetId, now);
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
return new ResourceDoesNotExistException(resourceClass, targetId);
|
throw new ResourceDoesNotExistException(resourceClass, targetId);
|
||||||
}
|
}
|
||||||
return isLinked(key, now) ? new ResourceToDeleteIsReferencedException() : null;
|
if (isLinked(key, now)) {
|
||||||
});
|
throw new ResourceToDeleteIsReferencedException();
|
||||||
if (failfastException != null) {
|
|
||||||
throw failfastException;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +164,7 @@ public final class ResourceFlowUtils {
|
||||||
throw new BadAuthInfoForResourceException();
|
throw new BadAuthInfoForResourceException();
|
||||||
}
|
}
|
||||||
// Check the authInfo against the contact.
|
// Check the authInfo against the contact.
|
||||||
verifyAuthInfo(authInfo, tm().transact(() -> tm().loadByKey(foundContact.get())));
|
verifyAuthInfo(authInfo, tm().loadByKey(foundContact.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that the given {@link AuthInfo} is valid for the given contact. */
|
/** Check that the given {@link AuthInfo} is valid for the given contact. */
|
||||||
|
|
|
@ -23,8 +23,8 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.config.RegistryConfig.Config;
|
import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.model.contact.ContactCommand.Check;
|
import google.registry.model.contact.ContactCommand.Check;
|
||||||
|
@ -45,7 +45,7 @@ import javax.inject.Inject;
|
||||||
* @error {@link google.registry.flows.FlowUtils.NotLoggedInException}
|
* @error {@link google.registry.flows.FlowUtils.NotLoggedInException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_CHECK)
|
@ReportingSpec(ActivityReportField.CONTACT_CHECK)
|
||||||
public final class ContactCheckFlow implements Flow {
|
public final class ContactCheckFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject @RegistrarId String registrarId;
|
@Inject @RegistrarId String registrarId;
|
||||||
|
|
|
@ -28,7 +28,7 @@ import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.exceptions.ResourceAlreadyExistsForThisClientException;
|
import google.registry.flows.exceptions.ResourceAlreadyExistsForThisClientException;
|
||||||
import google.registry.flows.exceptions.ResourceCreateContentionException;
|
import google.registry.flows.exceptions.ResourceCreateContentionException;
|
||||||
|
@ -54,7 +54,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link ContactFlowUtils.DeclineContactDisclosureFieldDisallowedPolicyException}
|
* @error {@link ContactFlowUtils.DeclineContactDisclosureFieldDisallowedPolicyException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_CREATE)
|
@ReportingSpec(ActivityReportField.CONTACT_CREATE)
|
||||||
public final class ContactCreateFlow implements TransactionalFlow {
|
public final class ContactCreateFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.model.contact.ContactHistory;
|
import google.registry.model.contact.ContactHistory;
|
||||||
|
@ -63,7 +63,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link google.registry.flows.exceptions.ResourceToDeleteIsReferencedException}
|
* @error {@link google.registry.flows.exceptions.ResourceToDeleteIsReferencedException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_DELETE)
|
@ReportingSpec(ActivityReportField.CONTACT_DELETE)
|
||||||
public final class ContactDeleteFlow implements TransactionalFlow {
|
public final class ContactDeleteFlow implements MutatingFlow {
|
||||||
|
|
||||||
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES =
|
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES =
|
||||||
ImmutableSet.of(
|
ImmutableSet.of(
|
||||||
|
|
|
@ -22,10 +22,10 @@ import static google.registry.model.EppResourceUtils.isLinked;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.model.contact.ContactInfoData;
|
import google.registry.model.contact.ContactInfoData;
|
||||||
|
@ -51,7 +51,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
* @error {@link google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_INFO)
|
@ReportingSpec(ActivityReportField.CONTACT_INFO)
|
||||||
public final class ContactInfoFlow implements Flow {
|
public final class ContactInfoFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject Clock clock;
|
@Inject Clock clock;
|
||||||
|
|
|
@ -30,7 +30,7 @@ import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.model.contact.ContactHistory;
|
import google.registry.model.contact.ContactHistory;
|
||||||
|
@ -60,7 +60,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_APPROVE)
|
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_APPROVE)
|
||||||
public final class ContactTransferApproveFlow implements TransactionalFlow {
|
public final class ContactTransferApproveFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
|
|
|
@ -30,7 +30,7 @@ import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.model.contact.ContactHistory;
|
import google.registry.model.contact.ContactHistory;
|
||||||
|
@ -60,7 +60,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link google.registry.flows.exceptions.NotTransferInitiatorException}
|
* @error {@link google.registry.flows.exceptions.NotTransferInitiatorException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_CANCEL)
|
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_CANCEL)
|
||||||
public final class ContactTransferCancelFlow implements TransactionalFlow {
|
public final class ContactTransferCancelFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
|
|
|
@ -21,9 +21,9 @@ import static google.registry.flows.contact.ContactFlowUtils.createTransferRespo
|
||||||
|
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
||||||
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
||||||
|
@ -52,7 +52,7 @@ import javax.inject.Inject;
|
||||||
* @error {@link google.registry.flows.exceptions.NotAuthorizedToViewTransferException}
|
* @error {@link google.registry.flows.exceptions.NotAuthorizedToViewTransferException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_QUERY)
|
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_QUERY)
|
||||||
public final class ContactTransferQueryFlow implements Flow {
|
public final class ContactTransferQueryFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject Optional<AuthInfo> authInfo;
|
@Inject Optional<AuthInfo> authInfo;
|
||||||
|
|
|
@ -30,7 +30,7 @@ import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
import google.registry.model.contact.ContactHistory;
|
import google.registry.model.contact.ContactHistory;
|
||||||
|
@ -59,7 +59,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
* @error {@link google.registry.flows.exceptions.NotPendingTransferException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_REJECT)
|
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_REJECT)
|
||||||
public final class ContactTransferRejectFlow implements TransactionalFlow {
|
public final class ContactTransferRejectFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject Optional<AuthInfo> authInfo;
|
@Inject Optional<AuthInfo> authInfo;
|
||||||
|
|
|
@ -33,7 +33,7 @@ import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.exceptions.AlreadyPendingTransferException;
|
import google.registry.flows.exceptions.AlreadyPendingTransferException;
|
||||||
import google.registry.flows.exceptions.ObjectAlreadySponsoredException;
|
import google.registry.flows.exceptions.ObjectAlreadySponsoredException;
|
||||||
|
@ -72,7 +72,7 @@ import org.joda.time.Duration;
|
||||||
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
|
* @error {@link google.registry.flows.exceptions.ResourceStatusProhibitsOperationException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_REQUEST)
|
@ReportingSpec(ActivityReportField.CONTACT_TRANSFER_REQUEST)
|
||||||
public final class ContactTransferRequestFlow implements TransactionalFlow {
|
public final class ContactTransferRequestFlow implements MutatingFlow {
|
||||||
|
|
||||||
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES =
|
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES =
|
||||||
ImmutableSet.of(
|
ImmutableSet.of(
|
||||||
|
|
|
@ -33,7 +33,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
|
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
|
||||||
import google.registry.model.contact.Contact;
|
import google.registry.model.contact.Contact;
|
||||||
|
@ -66,7 +66,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link ContactFlowUtils.DeclineContactDisclosureFieldDisallowedPolicyException}
|
* @error {@link ContactFlowUtils.DeclineContactDisclosureFieldDisallowedPolicyException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.CONTACT_UPDATE)
|
@ReportingSpec(ActivityReportField.CONTACT_UPDATE)
|
||||||
public final class ContactUpdateFlow implements TransactionalFlow {
|
public final class ContactUpdateFlow implements MutatingFlow {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note that CLIENT_UPDATE_PROHIBITED is intentionally not in this list. This is because it
|
* Note that CLIENT_UPDATE_PROHIBITED is intentionally not in this list. This is because it
|
||||||
|
|
|
@ -43,9 +43,9 @@ import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
import google.registry.flows.EppException.ParameterValuePolicyErrorException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.custom.DomainCheckFlowCustomLogic;
|
import google.registry.flows.custom.DomainCheckFlowCustomLogic;
|
||||||
import google.registry.flows.custom.DomainCheckFlowCustomLogic.BeforeResponseParameters;
|
import google.registry.flows.custom.DomainCheckFlowCustomLogic.BeforeResponseParameters;
|
||||||
|
@ -121,7 +121,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link OnlyCheckedNamesCanBeFeeCheckedException}
|
* @error {@link OnlyCheckedNamesCanBeFeeCheckedException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_CHECK)
|
@ReportingSpec(ActivityReportField.DOMAIN_CHECK)
|
||||||
public final class DomainCheckFlow implements Flow {
|
public final class DomainCheckFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
|
@ -382,17 +382,13 @@ public final class DomainCheckFlow implements Flow {
|
||||||
|
|
||||||
private ImmutableMap<String, BillingRecurrence> loadRecurrencesForDomains(
|
private ImmutableMap<String, BillingRecurrence> loadRecurrencesForDomains(
|
||||||
ImmutableMap<String, Domain> domainObjs) {
|
ImmutableMap<String, Domain> domainObjs) {
|
||||||
return tm().transact(
|
|
||||||
() -> {
|
|
||||||
ImmutableMap<VKey<? extends BillingRecurrence>, BillingRecurrence> recurrences =
|
ImmutableMap<VKey<? extends BillingRecurrence>, BillingRecurrence> recurrences =
|
||||||
tm().loadByKeys(
|
tm().loadByKeys(
|
||||||
domainObjs.values().stream()
|
domainObjs.values().stream()
|
||||||
.map(Domain::getAutorenewBillingEvent)
|
.map(Domain::getAutorenewBillingEvent)
|
||||||
.collect(toImmutableSet()));
|
.collect(toImmutableSet()));
|
||||||
return ImmutableMap.copyOf(
|
return ImmutableMap.copyOf(
|
||||||
Maps.transformValues(
|
Maps.transformValues(domainObjs, d -> recurrences.get(d.getAutorenewBillingEvent())));
|
||||||
domainObjs, d -> recurrences.get(d.getAutorenewBillingEvent())));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,7 +23,6 @@ import static google.registry.flows.domain.DomainFlowUtils.validateDomainNameWit
|
||||||
import static google.registry.flows.domain.DomainFlowUtils.verifyClaimsPeriodNotEnded;
|
import static google.registry.flows.domain.DomainFlowUtils.verifyClaimsPeriodNotEnded;
|
||||||
import static google.registry.flows.domain.DomainFlowUtils.verifyNotInPredelegation;
|
import static google.registry.flows.domain.DomainFlowUtils.verifyNotInPredelegation;
|
||||||
import static google.registry.model.domain.launch.LaunchPhase.CLAIMS;
|
import static google.registry.model.domain.launch.LaunchPhase.CLAIMS;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
@ -32,9 +31,9 @@ import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.EppException.CommandUseErrorException;
|
import google.registry.flows.EppException.CommandUseErrorException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.domain.DomainCommand.Check;
|
import google.registry.model.domain.DomainCommand.Check;
|
||||||
import google.registry.model.domain.launch.LaunchCheckExtension;
|
import google.registry.model.domain.launch.LaunchCheckExtension;
|
||||||
|
@ -68,7 +67,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link DomainClaimsCheckNotAllowedWithAllocationTokens}
|
* @error {@link DomainClaimsCheckNotAllowedWithAllocationTokens}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_CHECK) // Claims check is a special domain check.
|
@ReportingSpec(ActivityReportField.DOMAIN_CHECK) // Claims check is a special domain check.
|
||||||
public final class DomainClaimsCheckFlow implements Flow {
|
public final class DomainClaimsCheckFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject EppInput eppInput;
|
@Inject EppInput eppInput;
|
||||||
|
@ -109,8 +108,7 @@ public final class DomainClaimsCheckFlow implements Flow {
|
||||||
verifyClaimsPeriodNotEnded(tld, now);
|
verifyClaimsPeriodNotEnded(tld, now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Optional<String> claimKey =
|
Optional<String> claimKey = ClaimsListDao.get().getClaimKey(parsedDomain.parts().get(0));
|
||||||
tm().transact(() -> ClaimsListDao.get().getClaimKey(parsedDomain.parts().get(0)));
|
|
||||||
launchChecksBuilder.add(
|
launchChecksBuilder.add(
|
||||||
LaunchCheck.create(
|
LaunchCheck.create(
|
||||||
LaunchCheckName.create(claimKey.isPresent(), domainName), claimKey.orElse(null)));
|
LaunchCheckName.create(claimKey.isPresent(), domainName), claimKey.orElse(null)));
|
||||||
|
|
|
@ -67,7 +67,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.custom.DomainCreateFlowCustomLogic;
|
import google.registry.flows.custom.DomainCreateFlowCustomLogic;
|
||||||
import google.registry.flows.custom.DomainCreateFlowCustomLogic.BeforeResponseParameters;
|
import google.registry.flows.custom.DomainCreateFlowCustomLogic.BeforeResponseParameters;
|
||||||
|
@ -210,7 +210,7 @@ import org.joda.time.Duration;
|
||||||
* @error {@link DomainPricingLogic.AllocationTokenInvalidForPremiumNameException}
|
* @error {@link DomainPricingLogic.AllocationTokenInvalidForPremiumNameException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_CREATE)
|
@ReportingSpec(ActivityReportField.DOMAIN_CREATE)
|
||||||
public final class DomainCreateFlow implements TransactionalFlow {
|
public final class DomainCreateFlow implements MutatingFlow {
|
||||||
|
|
||||||
/** Anchor tenant creates should always be for 2 years, since they get 2 years free. */
|
/** Anchor tenant creates should always be for 2 years, since they get 2 years free. */
|
||||||
private static final int ANCHOR_TENANT_CREATE_VALID_YEARS = 2;
|
private static final int ANCHOR_TENANT_CREATE_VALID_YEARS = 2;
|
||||||
|
|
|
@ -51,8 +51,8 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.SessionMetadata;
|
import google.registry.flows.SessionMetadata;
|
||||||
import google.registry.flows.TransactionalFlow;
|
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.custom.DomainDeleteFlowCustomLogic;
|
import google.registry.flows.custom.DomainDeleteFlowCustomLogic;
|
||||||
import google.registry.flows.custom.DomainDeleteFlowCustomLogic.AfterValidationParameters;
|
import google.registry.flows.custom.DomainDeleteFlowCustomLogic.AfterValidationParameters;
|
||||||
|
@ -115,7 +115,7 @@ import org.joda.time.Duration;
|
||||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_DELETE)
|
@ReportingSpec(ActivityReportField.DOMAIN_DELETE)
|
||||||
public final class DomainDeleteFlow implements TransactionalFlow {
|
public final class DomainDeleteFlow implements MutatingFlow {
|
||||||
|
|
||||||
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES = ImmutableSet.of(
|
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES = ImmutableSet.of(
|
||||||
StatusValue.CLIENT_DELETE_PROHIBITED,
|
StatusValue.CLIENT_DELETE_PROHIBITED,
|
||||||
|
|
|
@ -28,10 +28,10 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.net.InternetDomainName;
|
import com.google.common.net.InternetDomainName;
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.custom.DomainInfoFlowCustomLogic;
|
import google.registry.flows.custom.DomainInfoFlowCustomLogic;
|
||||||
import google.registry.flows.custom.DomainInfoFlowCustomLogic.AfterValidationParameters;
|
import google.registry.flows.custom.DomainInfoFlowCustomLogic.AfterValidationParameters;
|
||||||
|
@ -76,7 +76,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link DomainFlowUtils.TransfersAreAlwaysForOneYearException}
|
* @error {@link DomainFlowUtils.TransfersAreAlwaysForOneYearException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_INFO)
|
@ReportingSpec(ActivityReportField.DOMAIN_INFO)
|
||||||
public final class DomainInfoFlow implements Flow {
|
public final class DomainInfoFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
|
@ -120,14 +120,12 @@ public final class DomainInfoFlow implements Flow {
|
||||||
.setLastEppUpdateTime(domain.getLastEppUpdateTime())
|
.setLastEppUpdateTime(domain.getLastEppUpdateTime())
|
||||||
.setRegistrationExpirationTime(domain.getRegistrationExpirationTime())
|
.setRegistrationExpirationTime(domain.getRegistrationExpirationTime())
|
||||||
.setLastTransferTime(domain.getLastTransferTime())
|
.setLastTransferTime(domain.getLastTransferTime())
|
||||||
.setRegistrant(
|
.setRegistrant(tm().loadByKey(domain.getRegistrant()).getContactId());
|
||||||
tm().transact(() -> tm().loadByKey(domain.getRegistrant())).getContactId());
|
|
||||||
// If authInfo is non-null, then the caller is authorized to see the full information since we
|
// If authInfo is non-null, then the caller is authorized to see the full information since we
|
||||||
// will have already verified the authInfo is valid.
|
// will have already verified the authInfo is valid.
|
||||||
if (registrarId.equals(domain.getCurrentSponsorRegistrarId()) || authInfo.isPresent()) {
|
if (registrarId.equals(domain.getCurrentSponsorRegistrarId()) || authInfo.isPresent()) {
|
||||||
infoBuilder
|
infoBuilder
|
||||||
.setContacts(
|
.setContacts(loadForeignKeyedDesignatedContacts(domain.getContacts()))
|
||||||
tm().transact(() -> loadForeignKeyedDesignatedContacts(domain.getContacts())))
|
|
||||||
.setSubordinateHosts(
|
.setSubordinateHosts(
|
||||||
hostsRequest.requestSubordinate() ? domain.getSubordinateHosts() : null)
|
hostsRequest.requestSubordinate() ? domain.getSubordinateHosts() : null)
|
||||||
.setCreationRegistrarId(domain.getCreationRegistrarId())
|
.setCreationRegistrarId(domain.getCreationRegistrarId())
|
||||||
|
@ -178,7 +176,7 @@ public final class DomainInfoFlow implements Flow {
|
||||||
pricingLogic,
|
pricingLogic,
|
||||||
Optional.empty(),
|
Optional.empty(),
|
||||||
false,
|
false,
|
||||||
tm().transact(() -> tm().loadByKey(domain.getAutorenewBillingEvent())));
|
tm().loadByKey(domain.getAutorenewBillingEvent()));
|
||||||
extensions.add(builder.build());
|
extensions.add(builder.build());
|
||||||
}
|
}
|
||||||
return extensions.build();
|
return extensions.build();
|
||||||
|
|
|
@ -44,7 +44,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.custom.DomainRenewFlowCustomLogic;
|
import google.registry.flows.custom.DomainRenewFlowCustomLogic;
|
||||||
import google.registry.flows.custom.DomainRenewFlowCustomLogic.AfterValidationParameters;
|
import google.registry.flows.custom.DomainRenewFlowCustomLogic.AfterValidationParameters;
|
||||||
|
@ -137,7 +137,7 @@ import org.joda.time.Duration;
|
||||||
* google.registry.flows.domain.token.AllocationTokenFlowUtils.AlreadyRedeemedAllocationTokenException}
|
* google.registry.flows.domain.token.AllocationTokenFlowUtils.AlreadyRedeemedAllocationTokenException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_RENEW)
|
@ReportingSpec(ActivityReportField.DOMAIN_RENEW)
|
||||||
public final class DomainRenewFlow implements TransactionalFlow {
|
public final class DomainRenewFlow implements MutatingFlow {
|
||||||
|
|
||||||
private static final ImmutableSet<StatusValue> RENEW_DISALLOWED_STATUSES = ImmutableSet.of(
|
private static final ImmutableSet<StatusValue> RENEW_DISALLOWED_STATUSES = ImmutableSet.of(
|
||||||
StatusValue.CLIENT_RENEW_PROHIBITED,
|
StatusValue.CLIENT_RENEW_PROHIBITED,
|
||||||
|
|
|
@ -42,7 +42,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.ImmutableObject;
|
import google.registry.model.ImmutableObject;
|
||||||
import google.registry.model.billing.BillingBase.Reason;
|
import google.registry.model.billing.BillingBase.Reason;
|
||||||
|
@ -112,7 +112,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link DomainRestoreRequestFlow.RestoreCommandIncludesChangesException}
|
* @error {@link DomainRestoreRequestFlow.RestoreCommandIncludesChangesException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_RGP_RESTORE_REQUEST)
|
@ReportingSpec(ActivityReportField.DOMAIN_RGP_RESTORE_REQUEST)
|
||||||
public final class DomainRestoreRequestFlow implements TransactionalFlow {
|
public final class DomainRestoreRequestFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
|
|
|
@ -41,7 +41,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.domain.token.AllocationTokenFlowUtils;
|
import google.registry.flows.domain.token.AllocationTokenFlowUtils;
|
||||||
import google.registry.model.ImmutableObject;
|
import google.registry.model.ImmutableObject;
|
||||||
|
@ -106,7 +106,7 @@ import org.joda.time.DateTime;
|
||||||
* google.registry.flows.domain.token.AllocationTokenFlowUtils.AlreadyRedeemedAllocationTokenException}
|
* google.registry.flows.domain.token.AllocationTokenFlowUtils.AlreadyRedeemedAllocationTokenException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_APPROVE)
|
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_APPROVE)
|
||||||
public final class DomainTransferApproveFlow implements TransactionalFlow {
|
public final class DomainTransferApproveFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject Optional<AuthInfo> authInfo;
|
@Inject Optional<AuthInfo> authInfo;
|
||||||
|
|
|
@ -37,7 +37,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.billing.BillingRecurrence;
|
import google.registry.model.billing.BillingRecurrence;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
|
@ -74,7 +74,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_CANCEL)
|
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_CANCEL)
|
||||||
public final class DomainTransferCancelFlow implements TransactionalFlow {
|
public final class DomainTransferCancelFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject Optional<AuthInfo> authInfo;
|
@Inject Optional<AuthInfo> authInfo;
|
||||||
|
|
|
@ -21,10 +21,10 @@ import static google.registry.flows.domain.DomainTransferUtils.createTransferRes
|
||||||
|
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.ResourceFlowUtils;
|
import google.registry.flows.ResourceFlowUtils;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
||||||
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
||||||
|
@ -56,7 +56,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link google.registry.flows.exceptions.NotAuthorizedToViewTransferException}
|
* @error {@link google.registry.flows.exceptions.NotAuthorizedToViewTransferException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_QUERY)
|
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_QUERY)
|
||||||
public final class DomainTransferQueryFlow implements Flow {
|
public final class DomainTransferQueryFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject Optional<AuthInfo> authInfo;
|
@Inject Optional<AuthInfo> authInfo;
|
||||||
|
|
|
@ -39,7 +39,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.billing.BillingRecurrence;
|
import google.registry.model.billing.BillingRecurrence;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
|
@ -76,7 +76,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
* @error {@link DomainFlowUtils.NotAuthorizedForTldException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_REJECT)
|
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_REJECT)
|
||||||
public final class DomainTransferRejectFlow implements TransactionalFlow {
|
public final class DomainTransferRejectFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject Optional<AuthInfo> authInfo;
|
@Inject Optional<AuthInfo> authInfo;
|
||||||
|
|
|
@ -45,7 +45,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.domain.token.AllocationTokenFlowUtils;
|
import google.registry.flows.domain.token.AllocationTokenFlowUtils;
|
||||||
import google.registry.flows.exceptions.AlreadyPendingTransferException;
|
import google.registry.flows.exceptions.AlreadyPendingTransferException;
|
||||||
|
@ -135,7 +135,7 @@ import org.joda.time.DateTime;
|
||||||
* google.registry.flows.domain.token.AllocationTokenFlowUtils.AlreadyRedeemedAllocationTokenException}
|
* google.registry.flows.domain.token.AllocationTokenFlowUtils.AlreadyRedeemedAllocationTokenException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_REQUEST)
|
@ReportingSpec(ActivityReportField.DOMAIN_TRANSFER_REQUEST)
|
||||||
public final class DomainTransferRequestFlow implements TransactionalFlow {
|
public final class DomainTransferRequestFlow implements MutatingFlow {
|
||||||
|
|
||||||
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES = ImmutableSet.of(
|
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES = ImmutableSet.of(
|
||||||
StatusValue.CLIENT_TRANSFER_PROHIBITED,
|
StatusValue.CLIENT_TRANSFER_PROHIBITED,
|
||||||
|
|
|
@ -55,7 +55,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.custom.DomainUpdateFlowCustomLogic;
|
import google.registry.flows.custom.DomainUpdateFlowCustomLogic;
|
||||||
import google.registry.flows.custom.DomainUpdateFlowCustomLogic.AfterValidationParameters;
|
import google.registry.flows.custom.DomainUpdateFlowCustomLogic.AfterValidationParameters;
|
||||||
|
@ -133,7 +133,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link DomainFlowUtils.UrgentAttributeNotSupportedException}
|
* @error {@link DomainFlowUtils.UrgentAttributeNotSupportedException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.DOMAIN_UPDATE)
|
@ReportingSpec(ActivityReportField.DOMAIN_UPDATE)
|
||||||
public final class DomainUpdateFlow implements TransactionalFlow {
|
public final class DomainUpdateFlow implements MutatingFlow {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of {@link StatusValue}s that prohibit updates.
|
* A list of {@link StatusValue}s that prohibit updates.
|
||||||
|
|
|
@ -23,8 +23,8 @@ import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.config.RegistryConfig.Config;
|
import google.registry.config.RegistryConfig.Config;
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.eppinput.ResourceCommand;
|
import google.registry.model.eppinput.ResourceCommand;
|
||||||
import google.registry.model.eppoutput.CheckData.HostCheck;
|
import google.registry.model.eppoutput.CheckData.HostCheck;
|
||||||
|
@ -45,7 +45,7 @@ import javax.inject.Inject;
|
||||||
* @error {@link google.registry.flows.FlowUtils.NotLoggedInException}
|
* @error {@link google.registry.flows.FlowUtils.NotLoggedInException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.HOST_CHECK)
|
@ReportingSpec(ActivityReportField.HOST_CHECK)
|
||||||
public final class HostCheckFlow implements Flow {
|
public final class HostCheckFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject @RegistrarId String registrarId;
|
@Inject @RegistrarId String registrarId;
|
||||||
|
|
|
@ -35,7 +35,7 @@ import google.registry.flows.EppException.RequiredParameterMissingException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.exceptions.ResourceAlreadyExistsForThisClientException;
|
import google.registry.flows.exceptions.ResourceAlreadyExistsForThisClientException;
|
||||||
import google.registry.flows.exceptions.ResourceCreateContentionException;
|
import google.registry.flows.exceptions.ResourceCreateContentionException;
|
||||||
|
@ -78,7 +78,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link UnexpectedExternalHostIpException}
|
* @error {@link UnexpectedExternalHostIpException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.HOST_CREATE)
|
@ReportingSpec(ActivityReportField.HOST_CREATE)
|
||||||
public final class HostCreateFlow implements TransactionalFlow {
|
public final class HostCreateFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ResourceCommand resourceCommand;
|
@Inject ResourceCommand resourceCommand;
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
|
|
|
@ -30,7 +30,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.EppResource;
|
import google.registry.model.EppResource;
|
||||||
import google.registry.model.domain.metadata.MetadataExtension;
|
import google.registry.model.domain.metadata.MetadataExtension;
|
||||||
|
@ -63,7 +63,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link HostFlowUtils.HostNameNotPunyCodedException}
|
* @error {@link HostFlowUtils.HostNameNotPunyCodedException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.HOST_DELETE)
|
@ReportingSpec(ActivityReportField.HOST_DELETE)
|
||||||
public final class HostDeleteFlow implements TransactionalFlow {
|
public final class HostDeleteFlow implements MutatingFlow {
|
||||||
|
|
||||||
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES =
|
private static final ImmutableSet<StatusValue> DISALLOWED_STATUSES =
|
||||||
ImmutableSet.of(
|
ImmutableSet.of(
|
||||||
|
|
|
@ -23,9 +23,9 @@ import static google.registry.persistence.transaction.TransactionManagerFactory.
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.model.domain.Domain;
|
import google.registry.model.domain.Domain;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
|
@ -50,7 +50,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link HostFlowUtils.HostNameNotPunyCodedException}
|
* @error {@link HostFlowUtils.HostNameNotPunyCodedException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.HOST_INFO)
|
@ReportingSpec(ActivityReportField.HOST_INFO)
|
||||||
public final class HostInfoFlow implements Flow {
|
public final class HostInfoFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject @RegistrarId String registrarId;
|
@Inject @RegistrarId String registrarId;
|
||||||
|
@ -77,8 +77,7 @@ public final class HostInfoFlow implements Flow {
|
||||||
// there is no superordinate domain, the host's own values for these fields will be correct.
|
// there is no superordinate domain, the host's own values for these fields will be correct.
|
||||||
if (host.isSubordinate()) {
|
if (host.isSubordinate()) {
|
||||||
Domain superordinateDomain =
|
Domain superordinateDomain =
|
||||||
tm().transact(
|
tm().loadByKey(host.getSuperordinateDomain()).cloneProjectedAtTime(now);
|
||||||
() -> tm().loadByKey(host.getSuperordinateDomain()).cloneProjectedAtTime(now));
|
|
||||||
hostInfoDataBuilder
|
hostInfoDataBuilder
|
||||||
.setCurrentSponsorRegistrarId(superordinateDomain.getCurrentSponsorRegistrarId())
|
.setCurrentSponsorRegistrarId(superordinateDomain.getCurrentSponsorRegistrarId())
|
||||||
.setLastTransferTime(host.computeLastTransferTime(superordinateDomain));
|
.setLastTransferTime(host.computeLastTransferTime(superordinateDomain));
|
||||||
|
|
|
@ -47,7 +47,7 @@ import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.FlowModule.Superuser;
|
import google.registry.flows.FlowModule.Superuser;
|
||||||
import google.registry.flows.FlowModule.TargetId;
|
import google.registry.flows.FlowModule.TargetId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.annotations.ReportingSpec;
|
import google.registry.flows.annotations.ReportingSpec;
|
||||||
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
|
import google.registry.flows.exceptions.ResourceHasClientUpdateProhibitedException;
|
||||||
import google.registry.model.EppResource;
|
import google.registry.model.EppResource;
|
||||||
|
@ -107,7 +107,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link RenameHostToExternalRemoveIpException}
|
* @error {@link RenameHostToExternalRemoveIpException}
|
||||||
*/
|
*/
|
||||||
@ReportingSpec(ActivityReportField.HOST_UPDATE)
|
@ReportingSpec(ActivityReportField.HOST_UPDATE)
|
||||||
public final class HostUpdateFlow implements TransactionalFlow {
|
public final class HostUpdateFlow implements MutatingFlow {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note that CLIENT_UPDATE_PROHIBITED is intentionally not in this list. This is because it
|
* Note that CLIENT_UPDATE_PROHIBITED is intentionally not in this list. This is because it
|
||||||
|
|
|
@ -31,7 +31,7 @@ import google.registry.flows.EppException.RequiredParameterMissingException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.PollMessageId;
|
import google.registry.flows.FlowModule.PollMessageId;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
import google.registry.flows.TransactionalFlow;
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.model.eppoutput.EppResponse;
|
import google.registry.model.eppoutput.EppResponse;
|
||||||
import google.registry.model.poll.MessageQueueInfo;
|
import google.registry.model.poll.MessageQueueInfo;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
|
@ -55,7 +55,7 @@ import org.joda.time.DateTime;
|
||||||
* @error {@link PollAckFlow.MissingMessageIdException}
|
* @error {@link PollAckFlow.MissingMessageIdException}
|
||||||
* @error {@link PollAckFlow.NotAuthorizedToAckMessageException}
|
* @error {@link PollAckFlow.NotAuthorizedToAckMessageException}
|
||||||
*/
|
*/
|
||||||
public final class PollAckFlow implements TransactionalFlow {
|
public final class PollAckFlow implements MutatingFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject @RegistrarId String registrarId;
|
@Inject @RegistrarId String registrarId;
|
||||||
|
|
|
@ -25,9 +25,9 @@ import static google.registry.persistence.transaction.TransactionManagerFactory.
|
||||||
import google.registry.flows.EppException;
|
import google.registry.flows.EppException;
|
||||||
import google.registry.flows.EppException.ParameterValueSyntaxErrorException;
|
import google.registry.flows.EppException.ParameterValueSyntaxErrorException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.Flow;
|
|
||||||
import google.registry.flows.FlowModule.PollMessageId;
|
import google.registry.flows.FlowModule.PollMessageId;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
|
import google.registry.flows.TransactionalFlow;
|
||||||
import google.registry.model.eppoutput.EppResponse;
|
import google.registry.model.eppoutput.EppResponse;
|
||||||
import google.registry.model.poll.MessageQueueInfo;
|
import google.registry.model.poll.MessageQueueInfo;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
|
@ -47,7 +47,7 @@ import org.joda.time.DateTime;
|
||||||
*
|
*
|
||||||
* @error {@link PollRequestFlow.UnexpectedMessageIdException}
|
* @error {@link PollRequestFlow.UnexpectedMessageIdException}
|
||||||
*/
|
*/
|
||||||
public final class PollRequestFlow implements Flow {
|
public final class PollRequestFlow implements TransactionalFlow {
|
||||||
|
|
||||||
@Inject ExtensionManager extensionManager;
|
@Inject ExtensionManager extensionManager;
|
||||||
@Inject @RegistrarId String registrarId;
|
@Inject @RegistrarId String registrarId;
|
||||||
|
@ -64,8 +64,6 @@ public final class PollRequestFlow implements Flow {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the oldest message from the queue.
|
// Return the oldest message from the queue.
|
||||||
return tm().transact(
|
|
||||||
() -> {
|
|
||||||
DateTime now = tm().getTransactionTime();
|
DateTime now = tm().getTransactionTime();
|
||||||
Optional<PollMessage> maybePollMessage = getFirstPollMessage(registrarId, now);
|
Optional<PollMessage> maybePollMessage = getFirstPollMessage(registrarId, now);
|
||||||
if (!maybePollMessage.isPresent()) {
|
if (!maybePollMessage.isPresent()) {
|
||||||
|
@ -83,7 +81,6 @@ public final class PollRequestFlow implements Flow {
|
||||||
.build())
|
.build())
|
||||||
.setMultipleResData(pollMessage.getResponseData())
|
.setMultipleResData(pollMessage.getResponseData())
|
||||||
.build();
|
.build();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Unexpected message id. */
|
/** Unexpected message id. */
|
||||||
|
|
|
@ -30,8 +30,8 @@ import google.registry.flows.EppException.UnimplementedExtensionException;
|
||||||
import google.registry.flows.EppException.UnimplementedObjectServiceException;
|
import google.registry.flows.EppException.UnimplementedObjectServiceException;
|
||||||
import google.registry.flows.ExtensionManager;
|
import google.registry.flows.ExtensionManager;
|
||||||
import google.registry.flows.FlowModule.RegistrarId;
|
import google.registry.flows.FlowModule.RegistrarId;
|
||||||
|
import google.registry.flows.MutatingFlow;
|
||||||
import google.registry.flows.SessionMetadata;
|
import google.registry.flows.SessionMetadata;
|
||||||
import google.registry.flows.TransactionalFlow;
|
|
||||||
import google.registry.flows.TransportCredentials;
|
import google.registry.flows.TransportCredentials;
|
||||||
import google.registry.model.eppcommon.ProtocolDefinition;
|
import google.registry.model.eppcommon.ProtocolDefinition;
|
||||||
import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
||||||
|
@ -62,7 +62,7 @@ import javax.inject.Inject;
|
||||||
* @error {@link LoginFlow.RegistrarAccountNotActiveException}
|
* @error {@link LoginFlow.RegistrarAccountNotActiveException}
|
||||||
* @error {@link LoginFlow.UnsupportedLanguageException}
|
* @error {@link LoginFlow.UnsupportedLanguageException}
|
||||||
*/
|
*/
|
||||||
public class LoginFlow implements TransactionalFlow {
|
public class LoginFlow implements MutatingFlow {
|
||||||
|
|
||||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ import static com.google.common.collect.Sets.difference;
|
||||||
import static com.google.common.collect.Sets.union;
|
import static com.google.common.collect.Sets.union;
|
||||||
import static google.registry.config.RegistryConfig.getEppResourceCachingDuration;
|
import static google.registry.config.RegistryConfig.getEppResourceCachingDuration;
|
||||||
import static google.registry.config.RegistryConfig.getEppResourceMaxCachedEntries;
|
import static google.registry.config.RegistryConfig.getEppResourceMaxCachedEntries;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.replicaTm;
|
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.util.CollectionUtils.nullToEmpty;
|
import static google.registry.util.CollectionUtils.nullToEmpty;
|
||||||
import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
||||||
|
@ -358,13 +357,13 @@ public abstract class EppResource extends UpdateAutoTimestampEntity implements B
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EppResource load(VKey<? extends EppResource> key) {
|
public EppResource load(VKey<? extends EppResource> key) {
|
||||||
return replicaTm().transact(() -> replicaTm().loadByKey(key));
|
return tm().reTransact(() -> tm().loadByKey(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<VKey<? extends EppResource>, EppResource> loadAll(
|
public Map<VKey<? extends EppResource>, EppResource> loadAll(
|
||||||
Iterable<? extends VKey<? extends EppResource>> keys) {
|
Iterable<? extends VKey<? extends EppResource>> keys) {
|
||||||
return replicaTm().transact(() -> replicaTm().loadByKeys(keys));
|
return tm().reTransact(() -> tm().loadByKeys(keys));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -403,7 +402,7 @@ public abstract class EppResource extends UpdateAutoTimestampEntity implements B
|
||||||
public static ImmutableMap<VKey<? extends EppResource>, EppResource> loadCached(
|
public static ImmutableMap<VKey<? extends EppResource>, EppResource> loadCached(
|
||||||
Iterable<VKey<? extends EppResource>> keys) {
|
Iterable<VKey<? extends EppResource>> keys) {
|
||||||
if (!RegistryConfig.isEppResourceCachingEnabled()) {
|
if (!RegistryConfig.isEppResourceCachingEnabled()) {
|
||||||
return tm().transact(() -> tm().loadByKeys(keys));
|
return tm().reTransact(() -> tm().loadByKeys(keys));
|
||||||
}
|
}
|
||||||
return ImmutableMap.copyOf(cacheEppResources.getAll(keys));
|
return ImmutableMap.copyOf(cacheEppResources.getAll(keys));
|
||||||
}
|
}
|
||||||
|
@ -416,7 +415,7 @@ public abstract class EppResource extends UpdateAutoTimestampEntity implements B
|
||||||
*/
|
*/
|
||||||
public static <T extends EppResource> T loadCached(VKey<T> key) {
|
public static <T extends EppResource> T loadCached(VKey<T> key) {
|
||||||
if (!RegistryConfig.isEppResourceCachingEnabled()) {
|
if (!RegistryConfig.isEppResourceCachingEnabled()) {
|
||||||
return tm().transact(() -> tm().loadByKey(key));
|
return tm().reTransact(() -> tm().loadByKey(key));
|
||||||
}
|
}
|
||||||
// Safe to cast because loading a Key<T> returns an entity of type T.
|
// Safe to cast because loading a Key<T> returns an entity of type T.
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
|
@ -109,7 +109,7 @@ public final class ForeignKeyUtils {
|
||||||
Class<E> clazz, Collection<String> foreignKeys, boolean useReplicaTm) {
|
Class<E> clazz, Collection<String> foreignKeys, boolean useReplicaTm) {
|
||||||
String fkProperty = RESOURCE_TYPE_TO_FK_PROPERTY.get(clazz);
|
String fkProperty = RESOURCE_TYPE_TO_FK_PROPERTY.get(clazz);
|
||||||
JpaTransactionManager tmToUse = useReplicaTm ? replicaTm() : tm();
|
JpaTransactionManager tmToUse = useReplicaTm ? replicaTm() : tm();
|
||||||
return tmToUse.transact(
|
return tmToUse.reTransact(
|
||||||
() ->
|
() ->
|
||||||
tmToUse
|
tmToUse
|
||||||
.query(
|
.query(
|
||||||
|
|
|
@ -145,14 +145,14 @@ public abstract class FlowTestCase<F extends Flow> {
|
||||||
sessionMetadata.setRegistrarId(registrarId);
|
sessionMetadata.setRegistrarId(registrarId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assertTransactionalFlow(boolean isTransactional) throws Exception {
|
public void assertMutatingFlow(boolean isMutating) throws Exception {
|
||||||
Class<? extends Flow> flowClass = FlowPicker.getFlowClass(eppLoader.getEpp());
|
Class<? extends Flow> flowClass = FlowPicker.getFlowClass(eppLoader.getEpp());
|
||||||
if (isTransactional) {
|
if (isMutating) {
|
||||||
assertThat(flowClass).isAssignableTo(TransactionalFlow.class);
|
assertThat(flowClass).isAssignableTo(MutatingFlow.class);
|
||||||
} else {
|
} else {
|
||||||
// There's no "isNotAssignableTo" in Truth.
|
// There's no "isNotAssignableTo" in Truth.
|
||||||
assertWithMessage(flowClass.getSimpleName() + " implements TransactionalFlow")
|
assertWithMessage(flowClass.getSimpleName() + " implements MutatingFlow")
|
||||||
.that(TransactionalFlow.class.isAssignableFrom(flowClass))
|
.that(MutatingFlow.class.isAssignableFrom(flowClass))
|
||||||
.isFalse();
|
.isFalse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ public abstract class ResourceCheckFlowTestCase<F extends Flow, R extends EppRes
|
||||||
extends ResourceFlowTestCase<F, R> {
|
extends ResourceFlowTestCase<F, R> {
|
||||||
|
|
||||||
protected void doCheckTest(CheckData.Check... expected) throws Exception {
|
protected void doCheckTest(CheckData.Check... expected) throws Exception {
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
assertThat(((CheckData) runFlow().getResponse().getResponseData().get(0)).getChecks())
|
assertThat(((CheckData) runFlow().getResponse().getResponseData().get(0)).getChecks())
|
||||||
.containsExactlyElementsIn(expected);
|
.containsExactlyElementsIn(expected);
|
||||||
assertNoHistory(); // Checks don't create a history event.
|
assertNoHistory(); // Checks don't create a history event.
|
||||||
|
|
|
@ -44,7 +44,7 @@ class ContactCreateFlowTest extends ResourceFlowTestCase<ContactCreateFlow, Cont
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doSuccessfulTest() throws Exception {
|
private void doSuccessfulTest() throws Exception {
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("contact_create_response.xml"));
|
runFlowAssertResponse(loadFile("contact_create_response.xml"));
|
||||||
// Check that the contact was created and persisted with a history entry.
|
// Check that the contact was created and persisted with a history entry.
|
||||||
Contact contact = reloadResourceByForeignKey();
|
Contact contact = reloadResourceByForeignKey();
|
||||||
|
|
|
@ -78,7 +78,7 @@ class ContactDeleteFlowTest extends ResourceFlowTestCase<ContactDeleteFlow, Cont
|
||||||
void testSuccess() throws Exception {
|
void testSuccess() throws Exception {
|
||||||
persistActiveContact(getUniqueIdFromCommand());
|
persistActiveContact(getUniqueIdFromCommand());
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("contact_delete_response.xml"));
|
runFlowAssertResponse(loadFile("contact_delete_response.xml"));
|
||||||
assertSqlDeleteSuccess();
|
assertSqlDeleteSuccess();
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ class ContactDeleteFlowTest extends ResourceFlowTestCase<ContactDeleteFlow, Cont
|
||||||
clock.nowUtc())
|
clock.nowUtc())
|
||||||
.getTransferData();
|
.getTransferData();
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("contact_delete_response.xml"));
|
runFlowAssertResponse(loadFile("contact_delete_response.xml"));
|
||||||
assertSqlDeleteSuccess(Type.CONTACT_DELETE, Type.CONTACT_TRANSFER_REQUEST);
|
assertSqlDeleteSuccess(Type.CONTACT_DELETE, Type.CONTACT_TRANSFER_REQUEST);
|
||||||
Contact softDeletedContact = reloadResourceByForeignKey(clock.nowUtc().minusMillis(1));
|
Contact softDeletedContact = reloadResourceByForeignKey(clock.nowUtc().minusMillis(1));
|
||||||
|
@ -130,7 +130,7 @@ class ContactDeleteFlowTest extends ResourceFlowTestCase<ContactDeleteFlow, Cont
|
||||||
setEppInput("contact_delete_no_cltrid.xml");
|
setEppInput("contact_delete_no_cltrid.xml");
|
||||||
persistActiveContact(getUniqueIdFromCommand());
|
persistActiveContact(getUniqueIdFromCommand());
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("contact_delete_response_no_cltrid.xml"));
|
runFlowAssertResponse(loadFile("contact_delete_response_no_cltrid.xml"));
|
||||||
assertSqlDeleteSuccess();
|
assertSqlDeleteSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, Contact>
|
||||||
void testSuccess() throws Exception {
|
void testSuccess() throws Exception {
|
||||||
persistContact(true);
|
persistContact(true);
|
||||||
// Check that the persisted contact info was returned.
|
// Check that the persisted contact info was returned.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile("contact_info_response.xml"),
|
loadFile("contact_info_response.xml"),
|
||||||
// We use a different roid scheme than the samples so ignore it.
|
// We use a different roid scheme than the samples so ignore it.
|
||||||
|
@ -123,7 +123,7 @@ class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, Contact>
|
||||||
createTld("foobar");
|
createTld("foobar");
|
||||||
persistResource(DatabaseHelper.newDomain("example.foobar", persistContact(true)));
|
persistResource(DatabaseHelper.newDomain("example.foobar", persistContact(true)));
|
||||||
// Check that the persisted contact info was returned.
|
// Check that the persisted contact info was returned.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile("contact_info_response_linked.xml"),
|
loadFile("contact_info_response_linked.xml"),
|
||||||
// We use a different roid scheme than the samples so ignore it.
|
// We use a different roid scheme than the samples so ignore it.
|
||||||
|
@ -137,7 +137,7 @@ class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, Contact>
|
||||||
setEppInput("contact_info_no_authinfo.xml");
|
setEppInput("contact_info_no_authinfo.xml");
|
||||||
persistContact(true);
|
persistContact(true);
|
||||||
// Check that the persisted contact info was returned.
|
// Check that the persisted contact info was returned.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile("contact_info_response.xml"),
|
loadFile("contact_info_response.xml"),
|
||||||
// We use a different roid scheme than the samples so ignore it.
|
// We use a different roid scheme than the samples so ignore it.
|
||||||
|
@ -151,7 +151,7 @@ class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, Contact>
|
||||||
setRegistrarIdForFlow("NewRegistrar");
|
setRegistrarIdForFlow("NewRegistrar");
|
||||||
persistContact(true);
|
persistContact(true);
|
||||||
// Check that the persisted contact info was returned.
|
// Check that the persisted contact info was returned.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
ResourceNotOwnedException thrown = assertThrows(ResourceNotOwnedException.class, this::runFlow);
|
ResourceNotOwnedException thrown = assertThrows(ResourceNotOwnedException.class, this::runFlow);
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, Contact>
|
||||||
setEppInput("contact_info_no_authinfo.xml");
|
setEppInput("contact_info_no_authinfo.xml");
|
||||||
persistContact(true);
|
persistContact(true);
|
||||||
// Check that the persisted contact info was returned.
|
// Check that the persisted contact info was returned.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
CommitMode.LIVE,
|
CommitMode.LIVE,
|
||||||
UserPrivileges.SUPERUSER,
|
UserPrivileges.SUPERUSER,
|
||||||
|
@ -178,7 +178,7 @@ class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, Contact>
|
||||||
setRegistrarIdForFlow("NewRegistrar");
|
setRegistrarIdForFlow("NewRegistrar");
|
||||||
persistContact(true);
|
persistContact(true);
|
||||||
// Check that the persisted contact info was returned.
|
// Check that the persisted contact info was returned.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
CommitMode.LIVE,
|
CommitMode.LIVE,
|
||||||
UserPrivileges.SUPERUSER,
|
UserPrivileges.SUPERUSER,
|
||||||
|
|
|
@ -69,7 +69,7 @@ class ContactTransferApproveFlowTest
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
contact = reloadResourceByForeignKey();
|
contact = reloadResourceByForeignKey();
|
||||||
TransferData originalTransferData = contact.getTransferData();
|
TransferData originalTransferData = contact.getTransferData();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
|
|
||||||
// Transfer should have succeeded. Verify correct fields were set.
|
// Transfer should have succeeded. Verify correct fields were set.
|
||||||
|
@ -120,7 +120,7 @@ class ContactTransferApproveFlowTest
|
||||||
private void doFailingTest(String commandFilename) throws Exception {
|
private void doFailingTest(String commandFilename) throws Exception {
|
||||||
setEppInput(commandFilename);
|
setEppInput(commandFilename);
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ class ContactTransferCancelFlowTest
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
contact = reloadResourceByForeignKey();
|
contact = reloadResourceByForeignKey();
|
||||||
TransferData originalTransferData = contact.getTransferData();
|
TransferData originalTransferData = contact.getTransferData();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
|
|
||||||
// Transfer should have been cancelled. Verify correct fields were set.
|
// Transfer should have been cancelled. Verify correct fields were set.
|
||||||
|
@ -104,7 +104,7 @@ class ContactTransferCancelFlowTest
|
||||||
private void doFailingTest(String commandFilename) throws Exception {
|
private void doFailingTest(String commandFilename) throws Exception {
|
||||||
this.setEppInput(commandFilename);
|
this.setEppInput(commandFilename);
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class ContactTransferQueryFlowTest
|
||||||
setEppInput(commandFilename);
|
setEppInput(commandFilename);
|
||||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
assertAboutContacts().that(reloadResourceByForeignKey(clock.nowUtc().minusDays(1)))
|
assertAboutContacts().that(reloadResourceByForeignKey(clock.nowUtc().minusDays(1)))
|
||||||
.hasOneHistoryEntryEachOfTypes(HistoryEntry.Type.CONTACT_TRANSFER_REQUEST);
|
.hasOneHistoryEntryEachOfTypes(HistoryEntry.Type.CONTACT_TRANSFER_REQUEST);
|
||||||
|
@ -64,7 +64,7 @@ class ContactTransferQueryFlowTest
|
||||||
setEppInput(commandFilename);
|
setEppInput(commandFilename);
|
||||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ class ContactTransferRejectFlowTest
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
contact = reloadResourceByForeignKey();
|
contact = reloadResourceByForeignKey();
|
||||||
TransferData originalTransferData = contact.getTransferData();
|
TransferData originalTransferData = contact.getTransferData();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
|
|
||||||
// Transfer should have failed. Verify correct fields were set.
|
// Transfer should have failed. Verify correct fields were set.
|
||||||
|
@ -119,7 +119,7 @@ class ContactTransferRejectFlowTest
|
||||||
private void doFailingTest(String commandFilename) throws Exception {
|
private void doFailingTest(String commandFilename) throws Exception {
|
||||||
setEppInput(commandFilename);
|
setEppInput(commandFilename);
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ class ContactTransferRequestFlowTest
|
||||||
DateTime afterTransfer = clock.nowUtc().plus(getContactAutomaticTransferLength());
|
DateTime afterTransfer = clock.nowUtc().plus(getContactAutomaticTransferLength());
|
||||||
|
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
|
|
||||||
// Transfer should have been requested. Verify correct fields were set.
|
// Transfer should have been requested. Verify correct fields were set.
|
||||||
|
@ -140,7 +140,7 @@ class ContactTransferRequestFlowTest
|
||||||
private void doFailingTest(String commandFilename) throws Exception {
|
private void doFailingTest(String commandFilename) throws Exception {
|
||||||
setEppInput(commandFilename);
|
setEppInput(commandFilename);
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class ContactUpdateFlowTest extends ResourceFlowTestCase<ContactUpdateFlow, Cont
|
||||||
|
|
||||||
private void doSuccessfulTest() throws Exception {
|
private void doSuccessfulTest() throws Exception {
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||||
Contact contact = reloadResourceByForeignKey();
|
Contact contact = reloadResourceByForeignKey();
|
||||||
// Check that the contact was updated. This value came from the xml.
|
// Check that the contact was updated. This value came from the xml.
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class DomainClaimsCheckFlowTest extends ResourceFlowTestCase<DomainClaims
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doSuccessfulTest(String expectedXmlFilename) throws Exception {
|
protected void doSuccessfulTest(String expectedXmlFilename) throws Exception {
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
assertNoHistory(); // Checks don't create a history event.
|
assertNoHistory(); // Checks don't create a history event.
|
||||||
assertNoBillingEvents(); // Checks are always free.
|
assertNoBillingEvents(); // Checks are always free.
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
|
@ -152,7 +152,7 @@ public class DomainClaimsCheckFlowTest extends ResourceFlowTestCase<DomainClaims
|
||||||
ImmutableMap.of("example2", "2013041500/2/6/9/rJ1NrDO92vDsAzf7EQzgjX4R0000000001"));
|
ImmutableMap.of("example2", "2013041500/2/6/9/rJ1NrDO92vDsAzf7EQzgjX4R0000000001"));
|
||||||
persistResource(
|
persistResource(
|
||||||
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
assertNoHistory(); // Checks don't create a history event.
|
assertNoHistory(); // Checks don't create a history event.
|
||||||
assertNoBillingEvents(); // Checks are always free.
|
assertNoBillingEvents(); // Checks are always free.
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
|
|
|
@ -428,7 +428,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||||
UserPrivileges userPrivileges,
|
UserPrivileges userPrivileges,
|
||||||
Map<String, String> substitutions)
|
Map<String, String> substitutions)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
CommitMode.LIVE, userPrivileges, loadFile(responseXmlFile, substitutions));
|
CommitMode.LIVE, userPrivileges, loadFile(responseXmlFile, substitutions));
|
||||||
assertSuccessfulCreate(domainTld, ImmutableSet.of());
|
assertSuccessfulCreate(domainTld, ImmutableSet.of());
|
||||||
|
@ -613,7 +613,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||||
createTld("foo.tld");
|
createTld("foo.tld");
|
||||||
setEppInput("domain_create_with_tld.xml", ImmutableMap.of("TLD", "foo.tld"));
|
setEppInput("domain_create_with_tld.xml", ImmutableMap.of("TLD", "foo.tld"));
|
||||||
persistContactsAndHosts("foo.tld");
|
persistContactsAndHosts("foo.tld");
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
String expectedResponseXml =
|
String expectedResponseXml =
|
||||||
loadFile("domain_create_response.xml", ImmutableMap.of("DOMAIN", "example.foo.tld"));
|
loadFile("domain_create_response.xml", ImmutableMap.of("DOMAIN", "example.foo.tld"));
|
||||||
runFlowAssertResponse(CommitMode.LIVE, UserPrivileges.NORMAL, expectedResponseXml);
|
runFlowAssertResponse(CommitMode.LIVE, UserPrivileges.NORMAL, expectedResponseXml);
|
||||||
|
|
|
@ -152,7 +152,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||||
.setAutorenewPollMessage(autorenewPollMessage.createVKey())
|
.setAutorenewPollMessage(autorenewPollMessage.createVKey())
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createReferencedEntities(DateTime expirationTime) throws Exception {
|
private void createReferencedEntities(DateTime expirationTime) throws Exception {
|
||||||
|
@ -217,7 +217,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||||
.setAutorenewBillingEvent(autorenewBillingEvent.createVKey())
|
.setAutorenewBillingEvent(autorenewBillingEvent.createVKey())
|
||||||
.setAutorenewPollMessage(autorenewPollMessage.createVKey())
|
.setAutorenewPollMessage(autorenewPollMessage.createVKey())
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertAutorenewClosedAndCancellationCreatedFor(
|
private void assertAutorenewClosedAndCancellationCreatedFor(
|
||||||
|
|
|
@ -177,7 +177,7 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
||||||
ImmutableMap<String, String> substitutions,
|
ImmutableMap<String, String> substitutions,
|
||||||
boolean expectHistoryAndBilling)
|
boolean expectHistoryAndBilling)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
String expected =
|
String expected =
|
||||||
loadFile(expectedXmlFilename, updateSubstitutions(substitutions, "ROID", "2FF-TLD"));
|
loadFile(expectedXmlFilename, updateSubstitutions(substitutions, "ROID", "2FF-TLD"));
|
||||||
if (inactive) {
|
if (inactive) {
|
||||||
|
|
|
@ -250,7 +250,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
||||||
RenewalPriceBehavior renewalPriceBehavior,
|
RenewalPriceBehavior renewalPriceBehavior,
|
||||||
@Nullable Money renewalPrice)
|
@Nullable Money renewalPrice)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
DateTime currentExpiration = reloadResourceByForeignKey().getRegistrationExpirationTime();
|
DateTime currentExpiration = reloadResourceByForeignKey().getRegistrationExpirationTime();
|
||||||
DateTime newExpiration = currentExpiration.plusYears(renewalYears);
|
DateTime newExpiration = currentExpiration.plusYears(renewalYears);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
|
|
|
@ -163,7 +163,7 @@ class DomainRestoreRequestFlowTest extends ResourceFlowTestCase<DomainRestoreReq
|
||||||
setEppInput("domain_update_restore_request.xml", ImmutableMap.of("DOMAIN", "example.tld"));
|
setEppInput("domain_update_restore_request.xml", ImmutableMap.of("DOMAIN", "example.tld"));
|
||||||
DateTime expirationTime = clock.nowUtc().plusYears(5).plusDays(45);
|
DateTime expirationTime = clock.nowUtc().plusYears(5).plusDays(45);
|
||||||
persistPendingDeleteDomain(expirationTime);
|
persistPendingDeleteDomain(expirationTime);
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
// Double check that we see a poll message in the future for when the delete happens.
|
// Double check that we see a poll message in the future for when the delete happens.
|
||||||
assertThat(getPollMessages("TheRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
assertThat(getPollMessages("TheRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
||||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||||
|
@ -231,7 +231,7 @@ class DomainRestoreRequestFlowTest extends ResourceFlowTestCase<DomainRestoreReq
|
||||||
DateTime expirationTime = clock.nowUtc().minusDays(20);
|
DateTime expirationTime = clock.nowUtc().minusDays(20);
|
||||||
DateTime newExpirationTime = expirationTime.plusYears(1);
|
DateTime newExpirationTime = expirationTime.plusYears(1);
|
||||||
persistPendingDeleteDomain(expirationTime);
|
persistPendingDeleteDomain(expirationTime);
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
// Double check that we see a poll message in the future for when the delete happens.
|
// Double check that we see a poll message in the future for when the delete happens.
|
||||||
assertThat(getPollMessages("TheRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
assertThat(getPollMessages("TheRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
||||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||||
|
|
|
@ -200,7 +200,7 @@ class DomainTransferApproveFlowTest
|
||||||
assertThat(getPollMessages(domain, "TheRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
assertThat(getPollMessages(domain, "TheRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
DomainTransferData originalTransferData = domain.getTransferData();
|
DomainTransferData originalTransferData = domain.getTransferData();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
// Transfer should have succeeded. Verify correct fields were set.
|
// Transfer should have succeeded. Verify correct fields were set.
|
||||||
domain = reloadResourceByForeignKey();
|
domain = reloadResourceByForeignKey();
|
||||||
|
@ -364,7 +364,7 @@ class DomainTransferApproveFlowTest
|
||||||
private void doFailingTest(String commandFilename) throws Exception {
|
private void doFailingTest(String commandFilename) throws Exception {
|
||||||
setEppLoader(commandFilename);
|
setEppLoader(commandFilename);
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ class DomainTransferCancelFlowTest
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
|
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
DateTime originalExpirationTime = domain.getRegistrationExpirationTime();
|
DateTime originalExpirationTime = domain.getRegistrationExpirationTime();
|
||||||
ImmutableSet<GracePeriod> originalGracePeriods = domain.getGracePeriods();
|
ImmutableSet<GracePeriod> originalGracePeriods = domain.getGracePeriods();
|
||||||
DomainTransferData originalTransferData = domain.getTransferData();
|
DomainTransferData originalTransferData = domain.getTransferData();
|
||||||
|
@ -190,7 +190,7 @@ class DomainTransferCancelFlowTest
|
||||||
// Replace the ROID in the xml file with the one generated in our test.
|
// Replace the ROID in the xml file with the one generated in our test.
|
||||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class DomainTransferQueryFlowTest
|
||||||
// Replace the ROID in the xml file with the one generated in our test.
|
// Replace the ROID in the xml file with the one generated in our test.
|
||||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
assertAboutDomains()
|
assertAboutDomains()
|
||||||
.that(domain)
|
.that(domain)
|
||||||
|
@ -76,7 +76,7 @@ class DomainTransferQueryFlowTest
|
||||||
// Replace the ROID in the xml file with the one generated in our test.
|
// Replace the ROID in the xml file with the one generated in our test.
|
||||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ class DomainTransferRejectFlowTest
|
||||||
assertThat(getPollMessages("NewRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
assertThat(getPollMessages("NewRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
||||||
assertThat(getPollMessages("TheRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
assertThat(getPollMessages("TheRegistrar", clock.nowUtc().plusMonths(1))).hasSize(1);
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
DateTime originalExpirationTime = domain.getRegistrationExpirationTime();
|
DateTime originalExpirationTime = domain.getRegistrationExpirationTime();
|
||||||
ImmutableSet<GracePeriod> originalGracePeriods = domain.getGracePeriods();
|
ImmutableSet<GracePeriod> originalGracePeriods = domain.getGracePeriods();
|
||||||
TransferData originalTransferData = domain.getTransferData();
|
TransferData originalTransferData = domain.getTransferData();
|
||||||
|
@ -152,7 +152,7 @@ class DomainTransferRejectFlowTest
|
||||||
// Replace the ROID in the xml file with the one generated in our test.
|
// Replace the ROID in the xml file with the one generated in our test.
|
||||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlow();
|
runFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -483,7 +483,7 @@ class DomainTransferRequestFlowTest
|
||||||
Tld registry = Tld.get(domain.getTld());
|
Tld registry = Tld.get(domain.getTld());
|
||||||
DateTime implicitTransferTime = clock.nowUtc().plus(registry.getAutomaticTransferLength());
|
DateTime implicitTransferTime = clock.nowUtc().plus(registry.getAutomaticTransferLength());
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename, substitutions));
|
runFlowAssertResponse(loadFile(expectedXmlFilename, substitutions));
|
||||||
// Transfer should have been requested.
|
// Transfer should have been requested.
|
||||||
domain = reloadResourceByForeignKey();
|
domain = reloadResourceByForeignKey();
|
||||||
|
@ -583,7 +583,7 @@ class DomainTransferRequestFlowTest
|
||||||
// the transfer timeline 3 days later by adjusting the implicit transfer time here.
|
// the transfer timeline 3 days later by adjusting the implicit transfer time here.
|
||||||
DateTime implicitTransferTime = clock.nowUtc().plus(expectedAutomaticTransferLength);
|
DateTime implicitTransferTime = clock.nowUtc().plus(expectedAutomaticTransferLength);
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile(expectedXmlFilename, substitutions));
|
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile(expectedXmlFilename, substitutions));
|
||||||
|
|
||||||
|
@ -634,7 +634,7 @@ class DomainTransferRequestFlowTest
|
||||||
// Replace the ROID in the xml file with the one generated in our test.
|
// Replace the ROID in the xml file with the one generated in our test.
|
||||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||||
// Setup done; run the test.
|
// Setup done; run the test.
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlow(CommitMode.LIVE, userPrivileges);
|
runFlow(CommitMode.LIVE, userPrivileges);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1741,7 +1741,7 @@ class DomainTransferRequestFlowTest
|
||||||
"domain_transfer_request_wildcard.xml",
|
"domain_transfer_request_wildcard.xml",
|
||||||
ImmutableMap.of("YEARS", "1", "DOMAIN", "--invalid", "EXDATE", "2002-09-08T22:00:00.0Z"));
|
ImmutableMap.of("YEARS", "1", "DOMAIN", "--invalid", "EXDATE", "2002-09-08T22:00:00.0Z"));
|
||||||
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
eppLoader.replaceAll("JD1234-REP", contact.getRepoId());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
ResourceDoesNotExistException thrown =
|
ResourceDoesNotExistException thrown =
|
||||||
assertThrows(
|
assertThrows(
|
||||||
ResourceDoesNotExistException.class,
|
ResourceDoesNotExistException.class,
|
||||||
|
|
|
@ -203,7 +203,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doSuccessfulTest(String expectedXmlFilename) throws Exception {
|
private void doSuccessfulTest(String expectedXmlFilename) throws Exception {
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||||
Domain domain = reloadResourceByForeignKey();
|
Domain domain = reloadResourceByForeignKey();
|
||||||
// Check that the domain was updated. These values came from the xml.
|
// Check that the domain was updated. These values came from the xml.
|
||||||
|
@ -341,7 +341,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||||
.setRegistrant(contacts.get(3).getContactKey())
|
.setRegistrant(contacts.get(3).getContactKey())
|
||||||
.build());
|
.build());
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||||
Domain domain = reloadResourceByForeignKey();
|
Domain domain = reloadResourceByForeignKey();
|
||||||
assertAboutDomains().that(domain).hasOneHistoryEntryEachOfTypes(DOMAIN_CREATE, DOMAIN_UPDATE);
|
assertAboutDomains().that(domain).hasOneHistoryEntryEachOfTypes(DOMAIN_CREATE, DOMAIN_UPDATE);
|
||||||
|
@ -407,7 +407,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||||
.createVKey()))
|
.createVKey()))
|
||||||
.build());
|
.build());
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||||
domain = reloadResourceByForeignKey();
|
domain = reloadResourceByForeignKey();
|
||||||
assertThat(domain.getNameservers()).containsExactly(addedHost.createVKey());
|
assertThat(domain.getNameservers()).containsExactly(addedHost.createVKey());
|
||||||
|
@ -490,7 +490,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setDsData(originalDsData)
|
.setDsData(originalDsData)
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||||
Domain resource = reloadResourceByForeignKey();
|
Domain resource = reloadResourceByForeignKey();
|
||||||
|
|
|
@ -81,7 +81,7 @@ class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Host> {
|
||||||
|
|
||||||
private void doSuccessfulTest() throws Exception {
|
private void doSuccessfulTest() throws Exception {
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("host_create_response.xml"));
|
runFlowAssertResponse(loadFile("host_create_response.xml"));
|
||||||
Host host = reloadResourceByForeignKey();
|
Host host = reloadResourceByForeignKey();
|
||||||
// Check that the host was created and persisted with a history entry.
|
// Check that the host was created and persisted with a history entry.
|
||||||
|
|
|
@ -77,7 +77,7 @@ class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Host> {
|
||||||
void testSuccess() throws Exception {
|
void testSuccess() throws Exception {
|
||||||
persistActiveHost("ns1.example.tld");
|
persistActiveHost("ns1.example.tld");
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("host_delete_response.xml"));
|
runFlowAssertResponse(loadFile("host_delete_response.xml"));
|
||||||
assertSqlDeleteSuccess();
|
assertSqlDeleteSuccess();
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Host> {
|
||||||
setEppInput("host_delete_no_cltrid.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld"));
|
setEppInput("host_delete_no_cltrid.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld"));
|
||||||
persistActiveHost("ns1.example.tld");
|
persistActiveHost("ns1.example.tld");
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("host_delete_response_no_cltrid.xml"));
|
runFlowAssertResponse(loadFile("host_delete_response_no_cltrid.xml"));
|
||||||
assertSqlDeleteSuccess();
|
assertSqlDeleteSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, Host> {
|
||||||
@Test
|
@Test
|
||||||
void testSuccess() throws Exception {
|
void testSuccess() throws Exception {
|
||||||
persistHost();
|
persistHost();
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
// Check that the persisted host info was returned.
|
// Check that the persisted host info was returned.
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile("host_info_response.xml"),
|
loadFile("host_info_response.xml"),
|
||||||
|
@ -100,7 +100,7 @@ class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, Host> {
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.addNameserver(persistHost().createVKey())
|
.addNameserver(persistHost().createVKey())
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
// Check that the persisted host info was returned.
|
// Check that the persisted host info was returned.
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile("host_info_response_linked.xml"),
|
loadFile("host_info_response_linked.xml"),
|
||||||
|
@ -131,7 +131,7 @@ class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, Host> {
|
||||||
.build());
|
.build());
|
||||||
// we shouldn't have two active hosts with the same hostname
|
// we shouldn't have two active hosts with the same hostname
|
||||||
deleteResource(firstHost);
|
deleteResource(firstHost);
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile("host_info_response_superordinate_clientid.xml"),
|
loadFile("host_info_response_superordinate_clientid.xml"),
|
||||||
// We use a different roid scheme than the samples so ignore it.
|
// We use a different roid scheme than the samples so ignore it.
|
||||||
|
|
|
@ -160,7 +160,7 @@ class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Host> {
|
||||||
|
|
||||||
private Host doSuccessfulTest(boolean isSuperuser) throws Exception {
|
private Host doSuccessfulTest(boolean isSuperuser) throws Exception {
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
CommitMode.LIVE,
|
CommitMode.LIVE,
|
||||||
isSuperuser ? UserPrivileges.SUPERUSER : UserPrivileges.NORMAL,
|
isSuperuser ? UserPrivileges.SUPERUSER : UserPrivileges.NORMAL,
|
||||||
|
|
|
@ -96,7 +96,7 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
.setMsg("Some poll message.")
|
.setMsg("Some poll message.")
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(contact))
|
.setHistoryEntry(createHistoryEntryForEppResource(contact))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("poll_ack_response_empty.xml"));
|
runFlowAssertResponse(loadFile("poll_ack_response_empty.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,14 +111,14 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
.setMsg("Some poll message.")
|
.setMsg("Some poll message.")
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(contact))
|
.setHistoryEntry(createHistoryEntryForEppResource(contact))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
assertThrows(MessageDoesNotExistException.class, this::runFlow);
|
assertThrows(MessageDoesNotExistException.class, this::runFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_messageOnContact() throws Exception {
|
void testSuccess_messageOnContact() throws Exception {
|
||||||
persistOneTimePollMessage(MESSAGE_ID);
|
persistOneTimePollMessage(MESSAGE_ID);
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("poll_ack_response_empty.xml"));
|
runFlowAssertResponse(loadFile("poll_ack_response_empty.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
void testSuccess_recentActiveAutorenew() throws Exception {
|
void testSuccess_recentActiveAutorenew() throws Exception {
|
||||||
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "3-2010"));
|
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "3-2010"));
|
||||||
persistAutorenewPollMessage(clock.nowUtc().minusMonths(6), END_OF_TIME);
|
persistAutorenewPollMessage(clock.nowUtc().minusMonths(6), END_OF_TIME);
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("poll_ack_response_empty.xml"));
|
runFlowAssertResponse(loadFile("poll_ack_response_empty.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
for (int i = 1; i < 4; i++) {
|
for (int i = 1; i < 4; i++) {
|
||||||
persistOneTimePollMessage(MESSAGE_ID + i);
|
persistOneTimePollMessage(MESSAGE_ID + i);
|
||||||
}
|
}
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile("poll_ack_response.xml", ImmutableMap.of("MSGID", "3-2009", "COUNT", "4")));
|
loadFile("poll_ack_response.xml", ImmutableMap.of("MSGID", "3-2009", "COUNT", "4")));
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
void testSuccess_oldInactiveAutorenew() throws Exception {
|
void testSuccess_oldInactiveAutorenew() throws Exception {
|
||||||
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "3-2010"));
|
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "3-2010"));
|
||||||
persistAutorenewPollMessage(clock.nowUtc().minusMonths(6), clock.nowUtc());
|
persistAutorenewPollMessage(clock.nowUtc().minusMonths(6), clock.nowUtc());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("poll_ack_response_empty.xml"));
|
runFlowAssertResponse(loadFile("poll_ack_response_empty.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,14 +158,14 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
persistOneTimePollMessage(MESSAGE_ID + i);
|
persistOneTimePollMessage(MESSAGE_ID + i);
|
||||||
}
|
}
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile("poll_ack_response.xml", ImmutableMap.of("MSGID", "3-2011", "COUNT", "4")));
|
loadFile("poll_ack_response.xml", ImmutableMap.of("MSGID", "3-2011", "COUNT", "4")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFailure_noSuchMessage() throws Exception {
|
void testFailure_noSuchMessage() throws Exception {
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
Exception e = assertThrows(MessageDoesNotExistException.class, this::runFlow);
|
Exception e = assertThrows(MessageDoesNotExistException.class, this::runFlow);
|
||||||
assertThat(e).hasMessageThat().contains(String.format("(%d-2011)", MESSAGE_ID));
|
assertThat(e).hasMessageThat().contains(String.format("(%d-2011)", MESSAGE_ID));
|
||||||
}
|
}
|
||||||
|
@ -173,14 +173,14 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
@Test
|
@Test
|
||||||
void testFailure_invalidId_tooFewComponents() throws Exception {
|
void testFailure_invalidId_tooFewComponents() throws Exception {
|
||||||
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "1"));
|
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "1"));
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
assertThrows(InvalidMessageIdException.class, this::runFlow);
|
assertThrows(InvalidMessageIdException.class, this::runFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFailure_invalidId_tooManyComponents() throws Exception {
|
void testFailure_invalidId_tooManyComponents() throws Exception {
|
||||||
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "2-2-1999-2007"));
|
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "2-2-1999-2007"));
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
assertThrows(InvalidMessageIdException.class, this::runFlow);
|
assertThrows(InvalidMessageIdException.class, this::runFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,21 +195,21 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
.setMsg("Some poll message.")
|
.setMsg("Some poll message.")
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(contact))
|
.setHistoryEntry(createHistoryEntryForEppResource(contact))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
assertThrows(InvalidMessageIdException.class, this::runFlow);
|
assertThrows(InvalidMessageIdException.class, this::runFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFailure_invalidId_stringInsteadOfNumeric() throws Exception {
|
void testFailure_invalidId_stringInsteadOfNumeric() throws Exception {
|
||||||
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "ABC-12345"));
|
setEppInput("poll_ack.xml", ImmutableMap.of("MSGID", "ABC-12345"));
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
assertThrows(InvalidMessageIdException.class, this::runFlow);
|
assertThrows(InvalidMessageIdException.class, this::runFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFailure_missingId() throws Exception {
|
void testFailure_missingId() throws Exception {
|
||||||
setEppInput("poll_ack_missing_id.xml");
|
setEppInput("poll_ack_missing_id.xml");
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
assertThrows(MissingMessageIdException.class, this::runFlow);
|
assertThrows(MissingMessageIdException.class, this::runFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
.setMsg("Some poll message.")
|
.setMsg("Some poll message.")
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
assertThrows(NotAuthorizedToAckMessageException.class, this::runFlow);
|
assertThrows(NotAuthorizedToAckMessageException.class, this::runFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
.setMsg("Some poll message.")
|
.setMsg("Some poll message.")
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
Exception e = assertThrows(MessageDoesNotExistException.class, this::runFlow);
|
Exception e = assertThrows(MessageDoesNotExistException.class, this::runFlow);
|
||||||
assertThat(e).hasMessageThat().contains(String.format("(%d-2011)", MESSAGE_ID));
|
assertThat(e).hasMessageThat().contains(String.format("(%d-2011)", MESSAGE_ID));
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_domainTransferApproved() throws Exception {
|
void testSuccess_domainTransferApproved() throws Exception {
|
||||||
persistPendingTransferPollMessage();
|
persistPendingTransferPollMessage();
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_domain_transfer.xml"));
|
runFlowAssertResponse(loadFile("poll_response_domain_transfer.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
void testSuccess_clTridNotSpecified() throws Exception {
|
void testSuccess_clTridNotSpecified() throws Exception {
|
||||||
setEppInput("poll_no_cltrid.xml");
|
setEppInput("poll_no_cltrid.xml");
|
||||||
persistPendingTransferPollMessage();
|
persistPendingTransferPollMessage();
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_domain_transfer_no_cltrid.xml"));
|
runFlowAssertResponse(loadFile("poll_response_domain_transfer_no_cltrid.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
.build()))
|
.build()))
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(contact))
|
.setHistoryEntry(createHistoryEntryForEppResource(contact))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_contact_transfer.xml"));
|
runFlowAssertResponse(loadFile("poll_response_contact_transfer.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
clock.nowUtc())))
|
clock.nowUtc())))
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_domain_pending_notification.xml"));
|
runFlowAssertResponse(loadFile("poll_response_domain_pending_notification.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
clock.nowUtc())))
|
clock.nowUtc())))
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_message_domain_pending_action_immediate_delete.xml"));
|
runFlowAssertResponse(loadFile("poll_message_domain_pending_action_immediate_delete.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
.setTargetId("test.example")
|
.setTargetId("test.example")
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_autorenew.xml"));
|
runFlowAssertResponse(loadFile("poll_response_autorenew.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
.setTargetId("target.example")
|
.setTargetId("target.example")
|
||||||
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
.setHistoryEntry(createHistoryEntryForEppResource(domain))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_empty.xml"));
|
runFlowAssertResponse(loadFile("poll_response_empty.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
.setHistoryEntry(historyEntry)
|
.setHistoryEntry(historyEntry)
|
||||||
.setEventTime(clock.nowUtc().minusDays(1))
|
.setEventTime(clock.nowUtc().minusDays(1))
|
||||||
.build());
|
.build());
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_contact_delete.xml"));
|
runFlowAssertResponse(loadFile("poll_response_contact_delete.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,14 +268,14 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
.setEventTime(clock.nowUtc().minusDays(1))
|
.setEventTime(clock.nowUtc().minusDays(1))
|
||||||
.build());
|
.build());
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_host_delete.xml"));
|
runFlowAssertResponse(loadFile("poll_response_host_delete.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFailure_messageIdProvided() throws Exception {
|
void testFailure_messageIdProvided() throws Exception {
|
||||||
setEppInput("poll_with_id.xml");
|
setEppInput("poll_with_id.xml");
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
EppException thrown = assertThrows(UnexpectedMessageIdException.class, this::runFlow);
|
EppException thrown = assertThrows(UnexpectedMessageIdException.class, this::runFlow);
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ class HelloFlowTest extends FlowTestCase<HelloFlow> {
|
||||||
@Test
|
@Test
|
||||||
void testHello() throws Exception {
|
void testHello() throws Exception {
|
||||||
setEppInput("hello.xml");
|
setEppInput("hello.xml");
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
runFlowAssertResponse(
|
runFlowAssertResponse(
|
||||||
loadFile(
|
loadFile(
|
||||||
"greeting.xml", ImmutableMap.of("DATE", clock.nowUtc().toString(dateTimeNoMillis()))));
|
"greeting.xml", ImmutableMap.of("DATE", clock.nowUtc().toString(dateTimeNoMillis()))));
|
||||||
|
|
|
@ -62,7 +62,7 @@ public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
||||||
// Also called in subclasses.
|
// Also called in subclasses.
|
||||||
void doSuccessfulTest(String xmlFilename) throws Exception {
|
void doSuccessfulTest(String xmlFilename) throws Exception {
|
||||||
setEppInput(xmlFilename);
|
setEppInput(xmlFilename);
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_setsIsLoginResponse() throws Exception {
|
void testSuccess_setsIsLoginResponse() throws Exception {
|
||||||
setEppInput("login_valid.xml");
|
setEppInput("login_valid.xml");
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
EppOutput output = runFlow();
|
EppOutput output = runFlow();
|
||||||
assertThat(output.getResponse().isLoginResponse()).isTrue();
|
assertThat(output.getResponse().isLoginResponse()).isTrue();
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ public abstract class LoginFlowTestCase extends FlowTestCase<LoginFlow> {
|
||||||
assertThat(registrar.verifyPassword("randomstring")).isFalse();
|
assertThat(registrar.verifyPassword("randomstring")).isFalse();
|
||||||
|
|
||||||
setEppInput("login_set_new_password.xml", ImmutableMap.of("NEWPW", "ANewPassword"));
|
setEppInput("login_set_new_password.xml", ImmutableMap.of("NEWPW", "ANewPassword"));
|
||||||
assertTransactionalFlow(true);
|
assertMutatingFlow(true);
|
||||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||||
|
|
||||||
Registrar newRegistrar = loadRegistrar("NewRegistrar");
|
Registrar newRegistrar = loadRegistrar("NewRegistrar");
|
||||||
|
|
|
@ -38,7 +38,7 @@ class LogoutFlowTest extends FlowTestCase<LogoutFlow> {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess() throws Exception {
|
void testSuccess() throws Exception {
|
||||||
assertTransactionalFlow(false);
|
assertMutatingFlow(false);
|
||||||
// All flow tests are implicitly logged in, so logout should work.
|
// All flow tests are implicitly logged in, so logout should work.
|
||||||
runFlowAssertResponse(loadFile("logout_response.xml"));
|
runFlowAssertResponse(loadFile("logout_response.xml"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue