Convert DomainTransferRequestFlow to tm() calls (#1002)

* Convert DomainTransferRequestFlow to tm() calls

Besides the standard ofy-to-tm conversions this includes storing the
billing event cancellation VKey in the DomainTransferData object so that
we know to handle it on process / cancellation.
This commit is contained in:
gbrodman 2021-03-15 20:01:59 -04:00 committed by GitHub
parent 72f176758d
commit 1263993733
4 changed files with 147 additions and 111 deletions

View file

@ -31,7 +31,6 @@ import static google.registry.flows.domain.DomainTransferUtils.createPendingTran
import static google.registry.flows.domain.DomainTransferUtils.createTransferResponse; import static google.registry.flows.domain.DomainTransferUtils.createTransferResponse;
import static google.registry.flows.domain.DomainTransferUtils.createTransferServerApproveEntities; import static google.registry.flows.domain.DomainTransferUtils.createTransferServerApproveEntities;
import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_ACTION_PENDING; import static google.registry.model.eppoutput.Result.Code.SUCCESS_WITH_ACTION_PENDING;
import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm; import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@ -227,12 +226,11 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
.setLastEppUpdateClientId(gainingClientId) .setLastEppUpdateClientId(gainingClientId)
.build(); .build();
asyncTaskEnqueuer.enqueueAsyncResave(newDomain, now, automaticTransferTime); asyncTaskEnqueuer.enqueueAsyncResave(newDomain, now, automaticTransferTime);
ofy().save() tm().putAll(
.entities(new ImmutableSet.Builder<>() new ImmutableSet.Builder<>()
.add(newDomain, historyEntry, requestPollMessage) .add(newDomain, historyEntry, requestPollMessage)
.addAll(serverApproveEntities) .addAll(serverApproveEntities)
.build()) .build());
.now();
return responseBuilder return responseBuilder
.setResultFromCode(SUCCESS_WITH_ACTION_PENDING) .setResultFromCode(SUCCESS_WITH_ACTION_PENDING)
.setResData(createResponse(period, existingDomain, newDomain, now)) .setResData(createResponse(period, existingDomain, newDomain, now))

View file

@ -15,6 +15,7 @@
package google.registry.model.transfer; package google.registry.model.transfer;
import static google.registry.util.CollectionUtils.forceEmptyToNull; import static google.registry.util.CollectionUtils.forceEmptyToNull;
import static google.registry.util.CollectionUtils.isNullOrEmpty;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -23,6 +24,7 @@ import com.googlecode.objectify.annotation.AlsoLoad;
import com.googlecode.objectify.annotation.Embed; import com.googlecode.objectify.annotation.Embed;
import com.googlecode.objectify.annotation.Ignore; import com.googlecode.objectify.annotation.Ignore;
import com.googlecode.objectify.annotation.IgnoreSave; import com.googlecode.objectify.annotation.IgnoreSave;
import com.googlecode.objectify.annotation.OnLoad;
import com.googlecode.objectify.annotation.Unindex; import com.googlecode.objectify.annotation.Unindex;
import com.googlecode.objectify.condition.IfNull; import com.googlecode.objectify.condition.IfNull;
import google.registry.model.billing.BillingEvent; import google.registry.model.billing.BillingEvent;
@ -31,6 +33,7 @@ import google.registry.model.domain.Period;
import google.registry.model.domain.Period.Unit; import google.registry.model.domain.Period.Unit;
import google.registry.model.poll.PollMessage; import google.registry.model.poll.PollMessage;
import google.registry.persistence.VKey; import google.registry.persistence.VKey;
import java.util.Set;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides; import javax.persistence.AttributeOverrides;
@ -80,7 +83,7 @@ public class DomainTransferData extends TransferData<DomainTransferData.Builder>
@Ignore @Ignore
@Column(name = "transfer_billing_cancellation_id") @Column(name = "transfer_billing_cancellation_id")
Long billingCancellationId; VKey<BillingEvent.Cancellation> billingCancellationId;
/** /**
* The regular one-time billing event that will be charged for a server-approved transfer. * The regular one-time billing event that will be charged for a server-approved transfer.
@ -218,11 +221,20 @@ public class DomainTransferData extends TransferData<DomainTransferData.Builder>
return serverApproveAutorenewPollMessageHistoryId; return serverApproveAutorenewPollMessageHistoryId;
} }
@OnLoad
@Override
void onLoad(
@AlsoLoad("serverApproveEntities")
Set<VKey<? extends TransferServerApproveEntity>> serverApproveEntities) {
super.onLoad(serverApproveEntities);
mapBillingCancellationEntityToField(serverApproveEntities, this);
}
@PostLoad @PostLoad
@Override @Override
void postLoad() { void postLoad() {
// The superclass's serverApproveEntities should include the billing events if present
super.postLoad(); super.postLoad();
// The superclass's serverApproveEntities should include the billing events if present
ImmutableSet.Builder<VKey<? extends TransferServerApproveEntity>> serverApproveEntitiesBuilder = ImmutableSet.Builder<VKey<? extends TransferServerApproveEntity>> serverApproveEntitiesBuilder =
new ImmutableSet.Builder<>(); new ImmutableSet.Builder<>();
if (serverApproveEntities != null) { if (serverApproveEntities != null) {
@ -234,8 +246,8 @@ public class DomainTransferData extends TransferData<DomainTransferData.Builder>
if (serverApproveAutorenewEvent != null) { if (serverApproveAutorenewEvent != null) {
serverApproveEntitiesBuilder.add(serverApproveAutorenewEvent); serverApproveEntitiesBuilder.add(serverApproveAutorenewEvent);
} }
if (serverApproveAutorenewPollMessage != null) { if (billingCancellationId != null) {
serverApproveEntitiesBuilder.add(serverApproveAutorenewPollMessage); serverApproveEntitiesBuilder.add(billingCancellationId);
} }
serverApproveEntities = forceEmptyToNull(serverApproveEntitiesBuilder.build()); serverApproveEntities = forceEmptyToNull(serverApproveEntitiesBuilder.build());
} }
@ -250,6 +262,23 @@ public class DomainTransferData extends TransferData<DomainTransferData.Builder>
return new Builder(clone(this)); return new Builder(clone(this));
} }
/** Maps serverApproveEntities set to the individual fields. */
@SuppressWarnings("unchecked")
static void mapBillingCancellationEntityToField(
Set<VKey<? extends TransferServerApproveEntity>> serverApproveEntities,
DomainTransferData domainTransferData) {
if (isNullOrEmpty(serverApproveEntities)) {
domainTransferData.billingCancellationId = null;
} else {
domainTransferData.billingCancellationId =
(VKey<BillingEvent.Cancellation>)
serverApproveEntities.stream()
.filter(k -> k.getKind().equals(BillingEvent.Cancellation.class))
.findFirst()
.orElse(null);
}
}
public static class Builder extends TransferData.Builder<DomainTransferData, Builder> { public static class Builder extends TransferData.Builder<DomainTransferData, Builder> {
/** Create a {@link DomainTransferData.Builder} wrapping a new instance. */ /** Create a {@link DomainTransferData.Builder} wrapping a new instance. */
public Builder() {} public Builder() {}
@ -259,6 +288,12 @@ public class DomainTransferData extends TransferData<DomainTransferData.Builder>
super(instance); super(instance);
} }
@Override
public DomainTransferData build() {
mapBillingCancellationEntityToField(getInstance().serverApproveEntities, getInstance());
return super.build();
}
public Builder setTransferPeriod(Period transferPeriod) { public Builder setTransferPeriod(Period transferPeriod) {
getInstance().transferPeriod = transferPeriod; getInstance().transferPeriod = transferPeriod;
return this; return this;

View file

@ -22,6 +22,7 @@ import static com.google.common.truth.Truth.assertWithMessage;
import static google.registry.model.eppcommon.EppXmlTransformer.marshal; import static google.registry.model.eppcommon.EppXmlTransformer.marshal;
import static google.registry.model.ofy.ObjectifyService.ofy; import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm; import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
import static google.registry.persistence.transaction.TransactionManagerUtil.transactIfJpaTm;
import static google.registry.testing.DatabaseHelper.stripBillingEventId; import static google.registry.testing.DatabaseHelper.stripBillingEventId;
import static google.registry.xml.XmlTestUtils.assertXmlEquals; import static google.registry.xml.XmlTestUtils.assertXmlEquals;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
@ -203,9 +204,12 @@ public abstract class FlowTestCase<F extends Flow> {
assertWithMessage("Billing event is present for grace period: " + gracePeriod) assertWithMessage("Billing event is present for grace period: " + gracePeriod)
.that(gracePeriod.hasBillingEvent()) .that(gracePeriod.hasBillingEvent())
.isTrue(); .isTrue();
return tm().loadByKey( return transactIfJpaTm(
firstNonNull( () ->
gracePeriod.getOneTimeBillingEvent(), gracePeriod.getRecurringBillingEvent())); tm().loadByKey(
firstNonNull(
gracePeriod.getOneTimeBillingEvent(),
gracePeriod.getRecurringBillingEvent())));
} }
/** /**

View file

@ -22,12 +22,12 @@ import static google.registry.batch.AsyncTaskEnqueuer.PARAM_REQUESTED_TIME;
import static google.registry.batch.AsyncTaskEnqueuer.PARAM_RESOURCE_KEY; import static google.registry.batch.AsyncTaskEnqueuer.PARAM_RESOURCE_KEY;
import static google.registry.batch.AsyncTaskEnqueuer.PATH_RESAVE_ENTITY; import static google.registry.batch.AsyncTaskEnqueuer.PATH_RESAVE_ENTITY;
import static google.registry.batch.AsyncTaskEnqueuer.QUEUE_ASYNC_ACTIONS; import static google.registry.batch.AsyncTaskEnqueuer.QUEUE_ASYNC_ACTIONS;
import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.model.registry.Registry.TldState.QUIET_PERIOD; import static google.registry.model.registry.Registry.TldState.QUIET_PERIOD;
import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL; import static google.registry.model.reporting.DomainTransactionRecord.TransactionReportField.TRANSFER_SUCCESSFUL;
import static google.registry.model.reporting.HistoryEntry.Type.DOMAIN_CREATE; import static google.registry.model.reporting.HistoryEntry.Type.DOMAIN_CREATE;
import static google.registry.model.reporting.HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST; import static google.registry.model.reporting.HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm; import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
import static google.registry.persistence.transaction.TransactionManagerUtil.transactIfJpaTm;
import static google.registry.testing.DatabaseHelper.assertBillingEvents; import static google.registry.testing.DatabaseHelper.assertBillingEvents;
import static google.registry.testing.DatabaseHelper.assertBillingEventsEqual; import static google.registry.testing.DatabaseHelper.assertBillingEventsEqual;
import static google.registry.testing.DatabaseHelper.assertPollMessagesEqual; import static google.registry.testing.DatabaseHelper.assertPollMessagesEqual;
@ -102,7 +102,9 @@ import google.registry.model.transfer.DomainTransferData;
import google.registry.model.transfer.TransferResponse; import google.registry.model.transfer.TransferResponse;
import google.registry.model.transfer.TransferStatus; import google.registry.model.transfer.TransferStatus;
import google.registry.persistence.VKey; import google.registry.persistence.VKey;
import google.registry.testing.DualDatabaseTest;
import google.registry.testing.TaskQueueHelper.TaskMatcher; import google.registry.testing.TaskQueueHelper.TaskMatcher;
import google.registry.testing.TestOfyAndSql;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -110,9 +112,9 @@ import org.joda.money.Money;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.Duration; import org.joda.time.Duration;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/** Unit tests for {@link DomainTransferRequestFlow}. */ /** Unit tests for {@link DomainTransferRequestFlow}. */
@DualDatabaseTest
class DomainTransferRequestFlowTest class DomainTransferRequestFlowTest
extends DomainTransferFlowTestCase<DomainTransferRequestFlow, DomainBase> { extends DomainTransferFlowTestCase<DomainTransferRequestFlow, DomainBase> {
@ -291,13 +293,15 @@ class DomainTransferRequestFlowTest
// Assert that the domain's TransferData server-approve billing events match the above. // Assert that the domain's TransferData server-approve billing events match the above.
if (expectTransferBillingEvent) { if (expectTransferBillingEvent) {
assertBillingEventsEqual( assertBillingEventsEqual(
tm().loadByKey(domain.getTransferData().getServerApproveBillingEvent()), transactIfJpaTm(
() -> tm().loadByKey(domain.getTransferData().getServerApproveBillingEvent())),
optionalTransferBillingEvent.get()); optionalTransferBillingEvent.get());
} else { } else {
assertThat(domain.getTransferData().getServerApproveBillingEvent()).isNull(); assertThat(domain.getTransferData().getServerApproveBillingEvent()).isNull();
} }
assertBillingEventsEqual( assertBillingEventsEqual(
tm().loadByKey(domain.getTransferData().getServerApproveAutorenewEvent()), transactIfJpaTm(
() -> tm().loadByKey(domain.getTransferData().getServerApproveAutorenewEvent())),
gainingClientAutorenew); gainingClientAutorenew);
// Assert that the full set of server-approve billing events is exactly the extra ones plus // Assert that the full set of server-approve billing events is exactly the extra ones plus
// the transfer billing event (if present) and the gaining client autorenew. // the transfer billing event (if present) and the gaining client autorenew.
@ -307,18 +311,14 @@ class DomainTransferRequestFlowTest
.collect(toImmutableSet()); .collect(toImmutableSet());
assertBillingEventsEqual( assertBillingEventsEqual(
Iterables.filter( Iterables.filter(
ofy() transactIfJpaTm(
.load() () ->
// Use toArray() to coerce the type to something keys() will accept. tm().loadByKeys(domain.getTransferData().getServerApproveEntities()).values()),
.keys(
domain.getTransferData().getServerApproveEntities().stream()
.map(VKey::getOfyKey)
.toArray(Key[]::new))
.values(),
BillingEvent.class), BillingEvent.class),
Sets.union(expectedServeApproveBillingEvents, extraBillingEvents)); Sets.union(expectedServeApproveBillingEvents, extraBillingEvents));
// The domain's autorenew billing event should still point to the losing client's event. // The domain's autorenew billing event should still point to the losing client's event.
BillingEvent.Recurring domainAutorenewEvent = tm().loadByKey(domain.getAutorenewBillingEvent()); BillingEvent.Recurring domainAutorenewEvent =
transactIfJpaTm(() -> tm().loadByKey(domain.getAutorenewBillingEvent()));
assertThat(domainAutorenewEvent.getClientId()).isEqualTo("TheRegistrar"); assertThat(domainAutorenewEvent.getClientId()).isEqualTo("TheRegistrar");
assertThat(domainAutorenewEvent.getRecurrenceEndTime()).isEqualTo(implicitTransferTime); assertThat(domainAutorenewEvent.getRecurrenceEndTime()).isEqualTo(implicitTransferTime);
// The original grace periods should remain untouched. // The original grace periods should remain untouched.
@ -414,20 +414,16 @@ class DomainTransferRequestFlowTest
// Assert that the poll messages show up in the TransferData server approve entities. // Assert that the poll messages show up in the TransferData server approve entities.
assertPollMessagesEqual( assertPollMessagesEqual(
tm().loadByKey(domain.getTransferData().getServerApproveAutorenewPollMessage()), transactIfJpaTm(
() -> tm().loadByKey(domain.getTransferData().getServerApproveAutorenewPollMessage())),
autorenewPollMessage); autorenewPollMessage);
// Assert that the full set of server-approve poll messages is exactly the server approve // Assert that the full set of server-approve poll messages is exactly the server approve
// OneTime messages to gaining and losing registrars plus the gaining client autorenew. // OneTime messages to gaining and losing registrars plus the gaining client autorenew.
assertPollMessagesEqual( assertPollMessagesEqual(
Iterables.filter( Iterables.filter(
ofy() transactIfJpaTm(
.load() () ->
// Use toArray() to coerce the type to something keys() will accept. tm().loadByKeys(domain.getTransferData().getServerApproveEntities()).values()),
.keys(
domain.getTransferData().getServerApproveEntities().stream()
.map(VKey::getOfyKey)
.toArray(Key[]::new))
.values(),
PollMessage.class), PollMessage.class),
ImmutableList.of( ImmutableList.of(
transferApprovedPollMessage, losingTransferApprovedPollMessage, autorenewPollMessage)); transferApprovedPollMessage, losingTransferApprovedPollMessage, autorenewPollMessage));
@ -447,7 +443,10 @@ class DomainTransferRequestFlowTest
.and() .and()
.hasLastEppUpdateClientId("NewRegistrar"); .hasLastEppUpdateClientId("NewRegistrar");
assertThat( assertThat(
tm().loadByKey(domainAfterAutomaticTransfer.getAutorenewBillingEvent()).getEventTime()) transactIfJpaTm(
() ->
tm().loadByKey(domainAfterAutomaticTransfer.getAutorenewBillingEvent())
.getEventTime()))
.isEqualTo(expectedExpirationTime); .isEqualTo(expectedExpirationTime);
// And after the expected grace time, the grace period should be gone. // And after the expected grace time, the grace period should be gone.
DomainBase afterGracePeriod = DomainBase afterGracePeriod =
@ -590,7 +589,7 @@ class DomainTransferRequestFlowTest
if (expectedAutomaticTransferLength.equals(Duration.ZERO)) { if (expectedAutomaticTransferLength.equals(Duration.ZERO)) {
// The transfer is going to happen immediately. To observe the domain in the pending transfer // The transfer is going to happen immediately. To observe the domain in the pending transfer
// state, grab it directly from the database. // state, grab it directly from the database.
domain = Iterables.getOnlyElement(ofy().load().type(DomainBase.class).list()); domain = Iterables.getOnlyElement(transactIfJpaTm(() -> tm().loadAllOf(DomainBase.class)));
assertThat(domain.getDomainName()).isEqualTo("example.tld"); assertThat(domain.getDomainName()).isEqualTo("example.tld");
} else { } else {
// Transfer should have been requested. // Transfer should have been requested.
@ -651,7 +650,7 @@ class DomainTransferRequestFlowTest
runTest(commandFilename, UserPrivileges.NORMAL, ImmutableMap.of()); runTest(commandFilename, UserPrivileges.NORMAL, ImmutableMap.of());
} }
@Test @TestOfyAndSql
void testDryRun() throws Exception { void testDryRun() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
setEppInput("domain_transfer_request.xml"); setEppInput("domain_transfer_request.xml");
@ -659,34 +658,34 @@ class DomainTransferRequestFlowTest
dryRunFlowAssertResponse(loadFile("domain_transfer_request_response.xml")); dryRunFlowAssertResponse(loadFile("domain_transfer_request_response.xml"));
} }
@Test @TestOfyAndSql
void testSuccess() throws Exception { void testSuccess() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_fee_v06() throws Exception { void testSuccess_fee_v06() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest( doSuccessfulTest(
"domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_06_MAP); "domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_06_MAP);
} }
@Test @TestOfyAndSql
void testSuccess_fee_v11() throws Exception { void testSuccess_fee_v11() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest( doSuccessfulTest(
"domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_11_MAP); "domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_11_MAP);
} }
@Test @TestOfyAndSql
void testSuccess_fee_v12() throws Exception { void testSuccess_fee_v12() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest( doSuccessfulTest(
"domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_12_MAP); "domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_12_MAP);
} }
@Test @TestOfyAndSql
void testSuccess_fee_withDefaultAttributes_v06() throws Exception { void testSuccess_fee_withDefaultAttributes_v06() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest( doSuccessfulTest(
@ -695,7 +694,7 @@ class DomainTransferRequestFlowTest
FEE_06_MAP); FEE_06_MAP);
} }
@Test @TestOfyAndSql
void testSuccess_fee_withDefaultAttributes_v11() throws Exception { void testSuccess_fee_withDefaultAttributes_v11() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest( doSuccessfulTest(
@ -704,7 +703,7 @@ class DomainTransferRequestFlowTest
FEE_11_MAP); FEE_11_MAP);
} }
@Test @TestOfyAndSql
void testSuccess_fee_withDefaultAttributes_v12() throws Exception { void testSuccess_fee_withDefaultAttributes_v12() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest( doSuccessfulTest(
@ -713,7 +712,7 @@ class DomainTransferRequestFlowTest
FEE_12_MAP); FEE_12_MAP);
} }
@Test @TestOfyAndSql
void testFailure_refundableFee_v06() { void testFailure_refundableFee_v06() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -723,7 +722,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_refundableFee_v11() { void testFailure_refundableFee_v11() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -733,7 +732,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_refundableFee_v12() { void testFailure_refundableFee_v12() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -743,7 +742,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_gracePeriodFee_v06() { void testFailure_gracePeriodFee_v06() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -753,7 +752,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_gracePeriodFee_v11() { void testFailure_gracePeriodFee_v11() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -763,7 +762,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_gracePeriodFee_v12() { void testFailure_gracePeriodFee_v12() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -773,7 +772,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_appliedFee_v06() { void testFailure_appliedFee_v06() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -783,7 +782,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_appliedFee_v11() { void testFailure_appliedFee_v11() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -793,7 +792,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_appliedFee_v12() { void testFailure_appliedFee_v12() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -803,7 +802,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_suspendedRegistrarCantTransferDomain() { void testFailure_suspendedRegistrarCantTransferDomain() {
setupDomain("example", "tld"); setupDomain("example", "tld");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -820,7 +819,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_pendingRegistrarCantTransferDomain() { void testFailure_pendingRegistrarCantTransferDomain() {
setupDomain("example", "tld"); setupDomain("example", "tld");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -837,7 +836,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testSuccess_nonDefaultAutomaticTransferLength() throws Exception { void testSuccess_nonDefaultAutomaticTransferLength() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
persistResource( persistResource(
@ -849,7 +848,7 @@ class DomainTransferRequestFlowTest
"domain_transfer_request.xml", "domain_transfer_request_response_15_minutes.xml"); "domain_transfer_request.xml", "domain_transfer_request_response_15_minutes.xml");
} }
@Test @TestOfyAndSql
void testSuccess_nonDefaultTransferGracePeriod() throws Exception { void testSuccess_nonDefaultTransferGracePeriod() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
persistResource( persistResource(
@ -860,14 +859,14 @@ class DomainTransferRequestFlowTest
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_missingPeriod_defaultsToOneYear() throws Exception { void testSuccess_missingPeriod_defaultsToOneYear() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest( doSuccessfulTest(
"domain_transfer_request_missing_period.xml", "domain_transfer_request_response.xml"); "domain_transfer_request_missing_period.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_canTransferAwayFromSuspendedRegistrar() throws Exception { void testSuccess_canTransferAwayFromSuspendedRegistrar() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -880,7 +879,7 @@ class DomainTransferRequestFlowTest
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_inQuietPeriod() throws Exception { void testSuccess_inQuietPeriod() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
persistResource( persistResource(
@ -891,7 +890,7 @@ class DomainTransferRequestFlowTest
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testFailure_multiYearPeriod() { void testFailure_multiYearPeriod() {
setupDomain("example", "tld"); setupDomain("example", "tld");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -902,7 +901,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testSuccess_superuserExtension_zeroPeriod_nonZeroAutomaticTransferLength() throws Exception { void testSuccess_superuserExtension_zeroPeriod_nonZeroAutomaticTransferLength() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -916,7 +915,7 @@ class DomainTransferRequestFlowTest
Duration.standardDays(5)); Duration.standardDays(5));
} }
@Test @TestOfyAndSql
void testSuccess_superuserExtension_zeroPeriod_zeroAutomaticTransferLength() throws Exception { void testSuccess_superuserExtension_zeroPeriod_zeroAutomaticTransferLength() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -930,7 +929,7 @@ class DomainTransferRequestFlowTest
Duration.ZERO); Duration.ZERO);
} }
@Test @TestOfyAndSql
void testSuccess_superuserExtension_nonZeroPeriod_nonZeroAutomaticTransferLength() void testSuccess_superuserExtension_nonZeroPeriod_nonZeroAutomaticTransferLength()
throws Exception { throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
@ -945,7 +944,7 @@ class DomainTransferRequestFlowTest
Duration.standardDays(5)); Duration.standardDays(5));
} }
@Test @TestOfyAndSql
void testSuccess_superuserExtension_zeroPeriod_autorenewGraceActive() throws Exception { void testSuccess_superuserExtension_zeroPeriod_autorenewGraceActive() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
VKey<BillingEvent.Recurring> existingAutorenewEvent = domain.getAutorenewBillingEvent(); VKey<BillingEvent.Recurring> existingAutorenewEvent = domain.getAutorenewBillingEvent();
@ -977,7 +976,7 @@ class DomainTransferRequestFlowTest
Duration.ZERO); Duration.ZERO);
} }
@Test @TestOfyAndSql
void testFailure_superuserExtension_twoYearPeriod() { void testFailure_superuserExtension_twoYearPeriod() {
setupDomain("example", "tld"); setupDomain("example", "tld");
eppRequestSource = EppRequestSource.TOOL; eppRequestSource = EppRequestSource.TOOL;
@ -991,7 +990,7 @@ class DomainTransferRequestFlowTest
ImmutableMap.of("PERIOD", "2", "AUTOMATIC_TRANSFER_LENGTH", "5"))); ImmutableMap.of("PERIOD", "2", "AUTOMATIC_TRANSFER_LENGTH", "5")));
} }
@Test @TestOfyAndSql
void testFailure_superuserExtension_zeroPeriod_feeTransferExtension() { void testFailure_superuserExtension_zeroPeriod_feeTransferExtension() {
setupDomain("example", "tld"); setupDomain("example", "tld");
eppRequestSource = EppRequestSource.TOOL; eppRequestSource = EppRequestSource.TOOL;
@ -1005,7 +1004,7 @@ class DomainTransferRequestFlowTest
ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "5"))); ImmutableMap.of("PERIOD", "0", "AUTOMATIC_TRANSFER_LENGTH", "5")));
} }
@Test @TestOfyAndSql
void testSuccess_cappedExpiration() throws Exception { void testSuccess_cappedExpiration() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
// Set the domain to expire 10 years from now (as if it were just created with a 10-year term). // Set the domain to expire 10 years from now (as if it were just created with a 10-year term).
@ -1022,14 +1021,14 @@ class DomainTransferRequestFlowTest
clock.nowUtc().plus(Registry.get("tld").getAutomaticTransferLength()).plusYears(10)); clock.nowUtc().plus(Registry.get("tld").getAutomaticTransferLength()).plusYears(10));
} }
@Test @TestOfyAndSql
void testSuccess_domainAuthInfo() throws Exception { void testSuccess_domainAuthInfo() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
doSuccessfulTest( doSuccessfulTest(
"domain_transfer_request_domain_authinfo.xml", "domain_transfer_request_response.xml"); "domain_transfer_request_domain_authinfo.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_customLogicFee() throws Exception { void testSuccess_customLogicFee() throws Exception {
setupDomain("expensive-domain", "foo"); setupDomain("expensive-domain", "foo");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -1048,7 +1047,7 @@ class DomainTransferRequestFlowTest
Optional.of(Money.of(USD, 111))); Optional.of(Money.of(USD, 111)));
} }
@Test @TestOfyAndSql
void testFailure_notAuthorizedForTld() { void testFailure_notAuthorizedForTld() {
setupDomain("example", "tld"); setupDomain("example", "tld");
persistResource( persistResource(
@ -1062,7 +1061,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testSuccess_superuserNotAuthorizedForTld() throws Exception { void testSuccess_superuserNotAuthorizedForTld() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
persistResource( persistResource(
@ -1072,7 +1071,7 @@ class DomainTransferRequestFlowTest
runTest("domain_transfer_request.xml", UserPrivileges.SUPERUSER); runTest("domain_transfer_request.xml", UserPrivileges.SUPERUSER);
} }
@Test @TestOfyAndSql
void testSuccess_autorenewGraceActive_onlyAtTransferRequestTime() throws Exception { void testSuccess_autorenewGraceActive_onlyAtTransferRequestTime() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
// Set the domain to have auto-renewed long enough ago that it is still in the autorenew grace // Set the domain to have auto-renewed long enough ago that it is still in the autorenew grace
@ -1102,7 +1101,7 @@ class DomainTransferRequestFlowTest
expirationTime.plusYears(1)); expirationTime.plusYears(1));
} }
@Test @TestOfyAndSql
void testSuccess_autorenewGraceActive_throughoutTransferWindow() throws Exception { void testSuccess_autorenewGraceActive_throughoutTransferWindow() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
VKey<BillingEvent.Recurring> existingAutorenewEvent = domain.getAutorenewBillingEvent(); VKey<BillingEvent.Recurring> existingAutorenewEvent = domain.getAutorenewBillingEvent();
@ -1141,7 +1140,7 @@ class DomainTransferRequestFlowTest
.setRecurringEventKey(existingAutorenewEvent)); .setRecurringEventKey(existingAutorenewEvent));
} }
@Test @TestOfyAndSql
void testSuccess_autorenewGraceActive_onlyAtAutomaticTransferTime() throws Exception { void testSuccess_autorenewGraceActive_onlyAtAutomaticTransferTime() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
VKey<BillingEvent.Recurring> existingAutorenewEvent = domain.getAutorenewBillingEvent(); VKey<BillingEvent.Recurring> existingAutorenewEvent = domain.getAutorenewBillingEvent();
@ -1169,7 +1168,7 @@ class DomainTransferRequestFlowTest
.setRecurringEventKey(existingAutorenewEvent)); .setRecurringEventKey(existingAutorenewEvent));
} }
@Test @TestOfyAndSql
void testSuccess_premiumNotBlocked() throws Exception { void testSuccess_premiumNotBlocked() throws Exception {
setupDomain("rich", "example"); setupDomain("rich", "example");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -1177,7 +1176,7 @@ class DomainTransferRequestFlowTest
runTest("domain_transfer_request_fee.xml", UserPrivileges.NORMAL, RICH_DOMAIN_MAP); runTest("domain_transfer_request_fee.xml", UserPrivileges.NORMAL, RICH_DOMAIN_MAP);
} }
@Test @TestOfyAndSql
void testSuccess_premiumNotBlockedInSuperuserMode() throws Exception { void testSuccess_premiumNotBlockedInSuperuserMode() throws Exception {
setupDomain("rich", "example"); setupDomain("rich", "example");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -1199,22 +1198,22 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_wrongCurrency_v06() { void testFailure_wrongCurrency_v06() {
runWrongCurrencyTest(FEE_06_MAP); runWrongCurrencyTest(FEE_06_MAP);
} }
@Test @TestOfyAndSql
void testFailure_wrongCurrency_v11() { void testFailure_wrongCurrency_v11() {
runWrongCurrencyTest(FEE_11_MAP); runWrongCurrencyTest(FEE_11_MAP);
} }
@Test @TestOfyAndSql
void testFailure_wrongCurrency_v12() { void testFailure_wrongCurrency_v12() {
runWrongCurrencyTest(FEE_12_MAP); runWrongCurrencyTest(FEE_12_MAP);
} }
@Test @TestOfyAndSql
void testFailure_unknownCurrency() { void testFailure_unknownCurrency() {
Map<String, String> substitutions = Maps.newHashMap(); Map<String, String> substitutions = Maps.newHashMap();
substitutions.putAll(FEE_06_MAP); substitutions.putAll(FEE_06_MAP);
@ -1225,7 +1224,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_feeGivenInWrongScale_v06() { void testFailure_feeGivenInWrongScale_v06() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -1235,7 +1234,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_feeGivenInWrongScale_v11() { void testFailure_feeGivenInWrongScale_v11() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -1245,7 +1244,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_feeGivenInWrongScale_v12() { void testFailure_feeGivenInWrongScale_v12() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -1268,25 +1267,25 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_wrongFeeAmount_v06() { void testFailure_wrongFeeAmount_v06() {
setupDomain("example", "tld"); setupDomain("example", "tld");
runWrongFeeAmountTest(FEE_06_MAP); runWrongFeeAmountTest(FEE_06_MAP);
} }
@Test @TestOfyAndSql
void testFailure_wrongFeeAmount_v11() { void testFailure_wrongFeeAmount_v11() {
setupDomain("example", "tld"); setupDomain("example", "tld");
runWrongFeeAmountTest(FEE_11_MAP); runWrongFeeAmountTest(FEE_11_MAP);
} }
@Test @TestOfyAndSql
void testFailure_wrongFeeAmount_v12() { void testFailure_wrongFeeAmount_v12() {
setupDomain("example", "tld"); setupDomain("example", "tld");
runWrongFeeAmountTest(FEE_12_MAP); runWrongFeeAmountTest(FEE_12_MAP);
} }
@Test @TestOfyAndSql
void testFailure_premiumBlocked() { void testFailure_premiumBlocked() {
setupDomain("rich", "example"); setupDomain("rich", "example");
// Modify the Registrar to block premium names. // Modify the Registrar to block premium names.
@ -1298,7 +1297,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_feeNotProvidedOnPremiumName() { void testFailure_feeNotProvidedOnPremiumName() {
setupDomain("rich", "example"); setupDomain("rich", "example");
EppException thrown = EppException thrown =
@ -1308,7 +1307,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_noAuthInfo() { void testFailure_noAuthInfo() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -1318,7 +1317,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_badContactPassword() { void testFailure_badContactPassword() {
setupDomain("example", "tld"); setupDomain("example", "tld");
// Change the contact's password so it does not match the password in the file. // Change the contact's password so it does not match the password in the file.
@ -1335,7 +1334,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_badContactRepoId() { void testFailure_badContactRepoId() {
setupDomain("example", "tld"); setupDomain("example", "tld");
// Set the contact to a different ROID, but don't persist it; this is just so the substitution // Set the contact to a different ROID, but don't persist it; this is just so the substitution
@ -1348,42 +1347,42 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testSuccess_clientApproved() throws Exception { void testSuccess_clientApproved() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
changeTransferStatus(TransferStatus.CLIENT_APPROVED); changeTransferStatus(TransferStatus.CLIENT_APPROVED);
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_clientRejected() throws Exception { void testSuccess_clientRejected() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
changeTransferStatus(TransferStatus.CLIENT_REJECTED); changeTransferStatus(TransferStatus.CLIENT_REJECTED);
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_clientCancelled() throws Exception { void testSuccess_clientCancelled() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
changeTransferStatus(TransferStatus.CLIENT_CANCELLED); changeTransferStatus(TransferStatus.CLIENT_CANCELLED);
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_serverApproved() throws Exception { void testSuccess_serverApproved() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
changeTransferStatus(TransferStatus.SERVER_APPROVED); changeTransferStatus(TransferStatus.SERVER_APPROVED);
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testSuccess_serverCancelled() throws Exception { void testSuccess_serverCancelled() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
changeTransferStatus(TransferStatus.SERVER_CANCELLED); changeTransferStatus(TransferStatus.SERVER_CANCELLED);
doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml"); doSuccessfulTest("domain_transfer_request.xml", "domain_transfer_request_response.xml");
} }
@Test @TestOfyAndSql
void testFailure_pending() { void testFailure_pending() {
setupDomain("example", "tld"); setupDomain("example", "tld");
domain = domain =
@ -1405,7 +1404,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_badDomainPassword() { void testFailure_badDomainPassword() {
setupDomain("example", "tld"); setupDomain("example", "tld");
// Change the domain's password so it does not match the password in the file. // Change the domain's password so it does not match the password in the file.
@ -1422,7 +1421,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_sponsoringClient() { void testFailure_sponsoringClient() {
setupDomain("example", "tld"); setupDomain("example", "tld");
setClientIdForFlow("TheRegistrar"); setClientIdForFlow("TheRegistrar");
@ -1433,7 +1432,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_deletedDomain() throws Exception { void testFailure_deletedDomain() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
domain = domain =
@ -1445,7 +1444,7 @@ class DomainTransferRequestFlowTest
assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand())); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand()));
} }
@Test @TestOfyAndSql
void testFailure_invalidDomain() throws Exception { void testFailure_invalidDomain() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
setEppInput( setEppInput(
@ -1460,7 +1459,7 @@ class DomainTransferRequestFlowTest
assertThat(thrown).hasMessageThat().contains("(--invalid)"); assertThat(thrown).hasMessageThat().contains("(--invalid)");
} }
@Test @TestOfyAndSql
void testFailure_nonexistentDomain() { void testFailure_nonexistentDomain() {
createTld("tld"); createTld("tld");
contact = persistActiveContact("jd1234"); contact = persistActiveContact("jd1234");
@ -1471,7 +1470,7 @@ class DomainTransferRequestFlowTest
assertThat(thrown).hasMessageThat().contains(String.format("(%s)", "example.tld")); assertThat(thrown).hasMessageThat().contains(String.format("(%s)", "example.tld"));
} }
@Test @TestOfyAndSql
void testFailure_periodInMonths() { void testFailure_periodInMonths() {
setupDomain("example", "tld"); setupDomain("example", "tld");
EppException thrown = EppException thrown =
@ -1481,7 +1480,7 @@ class DomainTransferRequestFlowTest
assertAboutEppExceptions().that(thrown).marshalsToXml(); assertAboutEppExceptions().that(thrown).marshalsToXml();
} }
@Test @TestOfyAndSql
void testFailure_clientTransferProhibited() { void testFailure_clientTransferProhibited() {
setupDomain("example", "tld"); setupDomain("example", "tld");
domain = domain =
@ -1494,7 +1493,7 @@ class DomainTransferRequestFlowTest
assertThat(thrown).hasMessageThat().contains("clientTransferProhibited"); assertThat(thrown).hasMessageThat().contains("clientTransferProhibited");
} }
@Test @TestOfyAndSql
void testFailure_serverTransferProhibited() { void testFailure_serverTransferProhibited() {
setupDomain("example", "tld"); setupDomain("example", "tld");
domain = domain =
@ -1507,7 +1506,7 @@ class DomainTransferRequestFlowTest
assertThat(thrown).hasMessageThat().contains("serverTransferProhibited"); assertThat(thrown).hasMessageThat().contains("serverTransferProhibited");
} }
@Test @TestOfyAndSql
void testFailure_pendingDelete() { void testFailure_pendingDelete() {
setupDomain("example", "tld"); setupDomain("example", "tld");
domain = persistResource(domain.asBuilder().addStatusValue(StatusValue.PENDING_DELETE).build()); domain = persistResource(domain.asBuilder().addStatusValue(StatusValue.PENDING_DELETE).build());
@ -1518,7 +1517,7 @@ class DomainTransferRequestFlowTest
assertThat(thrown).hasMessageThat().contains("pendingDelete"); assertThat(thrown).hasMessageThat().contains("pendingDelete");
} }
@Test @TestOfyAndSql
void testIcannActivityReportField_getsLogged() throws Exception { void testIcannActivityReportField_getsLogged() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
clock.advanceOneMilli(); clock.advanceOneMilli();
@ -1527,7 +1526,7 @@ class DomainTransferRequestFlowTest
assertTldsFieldLogged("tld"); assertTldsFieldLogged("tld");
} }
@Test @TestOfyAndSql
void testIcannTransactionRecord_getsStored() throws Exception { void testIcannTransactionRecord_getsStored() throws Exception {
setupDomain("example", "tld"); setupDomain("example", "tld");
persistResource( persistResource(