mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 17:01:51 +02:00
Merge DomainResource into DomainBase
This eliminates the use of Objectify polymorphism for EPP resources entirely (yay!), which makes the Registry 3.0 database migration easier. It is unfortunate that the naming parallelism of EppResources is lost between ContactResource, HostResource, and DomainResource, but the actual type as far as Datastore was concerned was DomainBase all along, and it would be a much more substantial data migration to allow us to continue using the class name DomainResource now that we're no longer using Objectify polymorphism. This simply isn't worth it. This also removes the polymorphic Datastore indexes (which will no longer function as of this change). The non-polymorphic replacement indexes were added in [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=230930546
This commit is contained in:
parent
97c2049669
commit
e2528875b2
166 changed files with 1525 additions and 1666 deletions
|
@ -59,7 +59,7 @@ import google.registry.flows.domain.DomainFlowUtils.TrailingDashException;
|
|||
import google.registry.flows.domain.DomainFlowUtils.TransfersAreAlwaysForOneYearException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.UnknownFeeCommandException;
|
||||
import google.registry.flows.exceptions.TooManyResourceChecksException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.Registry.TldState;
|
||||
|
@ -74,7 +74,7 @@ import org.junit.Test;
|
|||
|
||||
/** Unit tests for {@link DomainCheckFlow}. */
|
||||
public class DomainCheckFlowTest
|
||||
extends ResourceCheckFlowTestCase<DomainCheckFlow, DomainResource> {
|
||||
extends ResourceCheckFlowTestCase<DomainCheckFlow, DomainBase> {
|
||||
|
||||
public DomainCheckFlowTest() {
|
||||
setEppInput("domain_check_one_tld.xml");
|
||||
|
|
|
@ -33,7 +33,7 @@ import google.registry.flows.domain.DomainFlowUtils.ClaimsPeriodEndedException;
|
|||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.TldDoesNotExistException;
|
||||
import google.registry.flows.exceptions.TooManyResourceChecksException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.registry.Registry.TldState;
|
||||
import org.junit.Before;
|
||||
|
@ -41,7 +41,7 @@ import org.junit.Test;
|
|||
|
||||
/** Unit tests for {@link DomainClaimsCheckFlow}. */
|
||||
public class DomainClaimsCheckFlowTest
|
||||
extends ResourceFlowTestCase<DomainClaimsCheckFlow, DomainResource> {
|
||||
extends ResourceFlowTestCase<DomainClaimsCheckFlow, DomainBase> {
|
||||
|
||||
public DomainClaimsCheckFlowTest() {
|
||||
setEppInput("domain_check_claims.xml");
|
||||
|
|
|
@ -46,7 +46,7 @@ import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
|||
import static google.registry.testing.DatastoreHelper.persistDeletedDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistReservedList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static google.registry.testing.TaskQueueHelper.assertDnsTasksEnqueued;
|
||||
|
@ -136,7 +136,7 @@ import google.registry.flows.exceptions.ResourceAlreadyExistsException;
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
|
@ -162,7 +162,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for {@link DomainCreateFlow}. */
|
||||
public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, DomainResource> {
|
||||
public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, DomainBase> {
|
||||
|
||||
private static final String CLAIMS_KEY = "2013041500/2/6/9/rJ1NrDO92vDsAzf7EQzgjX4R0000000001";
|
||||
|
||||
|
@ -212,7 +212,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
|
||||
private void assertSuccessfulCreate(
|
||||
String domainTld, ImmutableSet<BillingEvent.Flag> expectedBillingFlags) throws Exception {
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
|
||||
// Calculate the total cost.
|
||||
Money cost =
|
||||
|
@ -1090,7 +1090,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
|
||||
// Check for SERVER_HOLD status, no DNS tasks enqueued, and collision poll message.
|
||||
assertNoDnsTasksEnqueued();
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
assertThat(domain.getStatusValues()).contains(SERVER_HOLD);
|
||||
assertPollMessagesWithCollisionOneTime(domain);
|
||||
}
|
||||
|
@ -1107,12 +1107,12 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
|
||||
// Check for SERVER_HOLD status, no DNS tasks enqueued, and collision poll message.
|
||||
assertNoDnsTasksEnqueued();
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
assertThat(domain.getStatusValues()).contains(SERVER_HOLD);
|
||||
assertPollMessagesWithCollisionOneTime(domain);
|
||||
}
|
||||
|
||||
private void assertPollMessagesWithCollisionOneTime(DomainResource domain) {
|
||||
private void assertPollMessagesWithCollisionOneTime(DomainBase domain) {
|
||||
HistoryEntry historyEntry = getHistoryEntries(domain).get(0);
|
||||
assertPollMessagesForResource(
|
||||
domain,
|
||||
|
@ -1266,7 +1266,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
CommitMode.LIVE,
|
||||
UserPrivileges.NORMAL,
|
||||
loadFile("domain_create_response.xml", substitutions));
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntry = getHistoryEntries(domain).get(0);
|
||||
assertPollMessagesForResource(
|
||||
domain,
|
||||
|
@ -2217,7 +2217,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
.setAddGracePeriodLength(Duration.standardMinutes(9))
|
||||
.build());
|
||||
runFlow();
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntry = getHistoryEntries(domain).get(0);
|
||||
assertThat(historyEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
|
@ -2233,7 +2233,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
persistContactsAndHosts();
|
||||
persistResource(Registry.get("tld").asBuilder().setTldType(TldType.TEST).build());
|
||||
runFlow();
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntry = getHistoryEntries(domain).get(0);
|
||||
// No transaction records should be stored for test TLDs
|
||||
assertThat(historyEntry.getDomainTransactionRecords()).isEmpty();
|
||||
|
|
|
@ -40,13 +40,13 @@ import static google.registry.testing.DatastoreHelper.getOnlyHistoryEntryOfType;
|
|||
import static google.registry.testing.DatastoreHelper.getOnlyPollMessage;
|
||||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainBase;
|
||||
import static google.registry.testing.DatastoreHelper.newHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveContact;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.HistoryEntrySubject.assertAboutHistoryEntries;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -77,7 +77,7 @@ import google.registry.model.billing.BillingEvent;
|
|||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
||||
|
@ -102,9 +102,9 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for {@link DomainDeleteFlow}. */
|
||||
public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, DomainResource> {
|
||||
public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, DomainBase> {
|
||||
|
||||
private DomainResource domain;
|
||||
private DomainBase domain;
|
||||
private HistoryEntry earlierHistoryEntry;
|
||||
|
||||
private static final DateTime TIME_BEFORE_FLOW = DateTime.parse("2000-06-06T22:00:00.0Z");
|
||||
|
@ -148,7 +148,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
// Persist a linked contact.
|
||||
ContactResource contact = persistActiveContact("sh8013");
|
||||
domain =
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(TIME_BEFORE_FLOW)
|
||||
.setRegistrant(Key.create(contact))
|
||||
|
@ -341,9 +341,9 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
runFlowAssertResponse(loadFile("domain_delete_response_pending.xml"));
|
||||
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
DateTime redemptionEndTime = domain.getLastEppUpdateTime().plusDays(3);
|
||||
DomainResource domainAtRedemptionTime = domain.cloneProjectedAtTime(redemptionEndTime);
|
||||
DomainBase domainAtRedemptionTime = domain.cloneProjectedAtTime(redemptionEndTime);
|
||||
assertAboutDomains()
|
||||
.that(domainAtRedemptionTime)
|
||||
.hasLastEppUpdateClientId("TheRegistrar")
|
||||
|
@ -394,7 +394,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
DateTime originalExpirationTime = domain.getRegistrationExpirationTime();
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(loadFile(responseFilename, substitutions));
|
||||
DomainResource resource = reloadResourceByForeignKey();
|
||||
DomainBase resource = reloadResourceByForeignKey();
|
||||
// Check that the domain is in the pending delete state.
|
||||
assertAboutDomains()
|
||||
.that(resource)
|
||||
|
@ -588,7 +588,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
setUpSuccessfulTest();
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(loadFile("domain_delete_response_pending.xml"));
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
assertThat(domain.getTransferData()).isEqualTo(TransferData.EMPTY);
|
||||
}
|
||||
|
||||
|
@ -601,7 +601,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
persistWithPendingTransfer(reloadResourceByForeignKey()).getTransferData();
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(loadFile("domain_delete_response_pending.xml"));
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
// Check that the domain is in the pending delete state.
|
||||
// The PENDING_TRANSFER status should be gone.
|
||||
assertAboutDomains()
|
||||
|
@ -685,14 +685,14 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
// Add a nameserver.
|
||||
HostResource host = persistResource(newHostResource("ns1.example.tld"));
|
||||
persistResource(
|
||||
loadByForeignKey(DomainResource.class, getUniqueIdFromCommand(), clock.nowUtc())
|
||||
loadByForeignKey(DomainBase.class, getUniqueIdFromCommand(), clock.nowUtc())
|
||||
.get()
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host)))
|
||||
.build());
|
||||
// Persist another domain that's already been deleted and references this contact and host.
|
||||
persistResource(
|
||||
newDomainResource("example1.tld")
|
||||
newDomainBase("example1.tld")
|
||||
.asBuilder()
|
||||
.setRegistrant(
|
||||
Key.create(loadByForeignKey(ContactResource.class, "sh8013", clock.nowUtc()).get()))
|
||||
|
@ -755,7 +755,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
|
||||
@Test
|
||||
public void testFailure_hasSubordinateHosts() throws Exception {
|
||||
DomainResource domain = persistActiveDomain(getUniqueIdFromCommand());
|
||||
DomainBase domain = persistActiveDomain(getUniqueIdFromCommand());
|
||||
HostResource subordinateHost =
|
||||
persistResource(
|
||||
newHostResource("ns1." + getUniqueIdFromCommand())
|
||||
|
@ -811,7 +811,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
@Test
|
||||
public void testFailure_clientDeleteProhibited() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.addStatusValue(StatusValue.CLIENT_DELETE_PROHIBITED)
|
||||
.build());
|
||||
|
@ -823,7 +823,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
@Test
|
||||
public void testFailure_serverDeleteProhibited() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.addStatusValue(StatusValue.SERVER_DELETE_PROHIBITED)
|
||||
.build());
|
||||
|
@ -835,7 +835,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
@Test
|
||||
public void testFailure_pendingDelete() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.addStatusValue(StatusValue.PENDING_DELETE)
|
||||
.build());
|
||||
|
@ -870,7 +870,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
@Test
|
||||
public void testFailure_metadataNotFromTool() throws Exception {
|
||||
setEppInput("domain_delete_metadata.xml");
|
||||
persistResource(newDomainResource(getUniqueIdFromCommand()));
|
||||
persistResource(newDomainBase(getUniqueIdFromCommand()));
|
||||
EppException thrown = assertThrows(OnlyToolCanPassMetadataException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
@ -1060,7 +1060,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response_pending.xml"));
|
||||
DomainResource resource = reloadResourceByForeignKey();
|
||||
DomainBase resource = reloadResourceByForeignKey();
|
||||
assertAboutDomains()
|
||||
.that(resource)
|
||||
.hasExactlyStatusValues(StatusValue.INACTIVE, StatusValue.PENDING_DELETE)
|
||||
|
@ -1086,7 +1086,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response_pending.xml"));
|
||||
DomainResource resource = reloadResourceByForeignKey();
|
||||
DomainBase resource = reloadResourceByForeignKey();
|
||||
assertAboutDomains()
|
||||
.that(resource)
|
||||
.hasExactlyStatusValues(StatusValue.INACTIVE, StatusValue.PENDING_DELETE)
|
||||
|
@ -1106,7 +1106,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(
|
||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response_pending.xml"));
|
||||
DomainResource resource = reloadResourceByForeignKey();
|
||||
DomainBase resource = reloadResourceByForeignKey();
|
||||
assertAboutDomains()
|
||||
.that(resource)
|
||||
.hasExactlyStatusValues(StatusValue.INACTIVE, StatusValue.PENDING_DELETE)
|
||||
|
|
|
@ -19,7 +19,7 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.testing.DatastoreHelper.assertNoBillingEvents;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainBase;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveContact;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -45,7 +45,7 @@ import google.registry.model.contact.ContactResource;
|
|||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
|
@ -59,14 +59,14 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for {@link DomainInfoFlow}. */
|
||||
public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, DomainResource> {
|
||||
public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, DomainBase> {
|
||||
|
||||
private ContactResource registrant;
|
||||
private ContactResource contact;
|
||||
private HostResource host1;
|
||||
private HostResource host2;
|
||||
private HostResource host3;
|
||||
private DomainResource domain;
|
||||
private DomainBase domain;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
|
@ -84,7 +84,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
|
|||
host2 = persistActiveHost("ns1.example.net");
|
||||
domain =
|
||||
persistResource(
|
||||
new DomainResource.Builder()
|
||||
new DomainBase.Builder()
|
||||
.setFullyQualifiedDomainName(domainName)
|
||||
.setRepoId("2FF-TLD")
|
||||
.setPersistedCurrentSponsorClientId("NewRegistrar")
|
||||
|
@ -419,7 +419,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
|
|||
@Test
|
||||
public void testFailure_existedButWasDeleted() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setDeletionTime(clock.nowUtc().minusDays(1))
|
||||
.build());
|
||||
|
|
|
@ -21,11 +21,11 @@ import static google.registry.testing.DatastoreHelper.assertBillingEvents;
|
|||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.getOnlyHistoryEntryOfType;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainBase;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.HistoryEntrySubject.assertAboutHistoryEntries;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -56,7 +56,7 @@ import google.registry.flows.exceptions.ResourceStatusProhibitsOperationExceptio
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
|
@ -75,7 +75,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for {@link DomainRenewFlow}. */
|
||||
public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainResource> {
|
||||
public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBase> {
|
||||
|
||||
private static final ImmutableMap<String, String> FEE_06_MAP =
|
||||
ImmutableMap.of("FEE_VERSION", "0.6", "FEE_NS", "fee");
|
||||
|
@ -94,7 +94,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
}
|
||||
|
||||
private void persistDomain(StatusValue... statusValues) throws Exception {
|
||||
DomainResource domain = newDomainResource(getUniqueIdFromCommand());
|
||||
DomainBase domain = newDomainBase(getUniqueIdFromCommand());
|
||||
HistoryEntry historyEntryDomainCreate =
|
||||
persistResource(
|
||||
new HistoryEntry.Builder()
|
||||
|
@ -157,7 +157,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
DateTime currentExpiration = reloadResourceByForeignKey().getRegistrationExpirationTime();
|
||||
DateTime newExpiration = currentExpiration.plusYears(renewalYears);
|
||||
runFlowAssertResponse(loadFile(responseFilename, substitutions));
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntryDomainRenew =
|
||||
getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_RENEW);
|
||||
assertThat(ofy().load().key(domain.getAutorenewBillingEvent()).now().getEventTime())
|
||||
|
@ -501,7 +501,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
@Test
|
||||
public void testFailure_pendingDelete() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setRegistrationExpirationTime(expirationTime)
|
||||
.setDeletionTime(clock.nowUtc().plusDays(1))
|
||||
|
@ -741,7 +741,7 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
.setRenewGracePeriodLength(Duration.standardMinutes(9))
|
||||
.build());
|
||||
runFlow();
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntry = getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_RENEW);
|
||||
assertThat(historyEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
|
|
|
@ -21,12 +21,12 @@ import static google.registry.testing.DatastoreHelper.createTld;
|
|||
import static google.registry.testing.DatastoreHelper.getOnlyHistoryEntryOfType;
|
||||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainBase;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistReservedList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static google.registry.testing.TaskQueueHelper.assertDnsTasksEnqueued;
|
||||
|
@ -58,7 +58,7 @@ import google.registry.flows.domain.DomainRestoreRequestFlow.RestoreCommandInclu
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
|
@ -76,7 +76,7 @@ import org.junit.Test;
|
|||
|
||||
/** Unit tests for {@link DomainRestoreRequestFlow}. */
|
||||
public class DomainRestoreRequestFlowTest
|
||||
extends ResourceFlowTestCase<DomainRestoreRequestFlow, DomainResource> {
|
||||
extends ResourceFlowTestCase<DomainRestoreRequestFlow, DomainBase> {
|
||||
|
||||
private static final ImmutableMap<String, String> FEE_06_MAP =
|
||||
ImmutableMap.of("FEE_VERSION", "0.6", "FEE_NS", "fee");
|
||||
|
@ -92,7 +92,7 @@ public class DomainRestoreRequestFlowTest
|
|||
}
|
||||
|
||||
void persistPendingDeleteDomain() throws Exception {
|
||||
DomainResource domain = newDomainResource(getUniqueIdFromCommand());
|
||||
DomainBase domain = newDomainBase(getUniqueIdFromCommand());
|
||||
HistoryEntry historyEntry =
|
||||
persistResource(
|
||||
new HistoryEntry.Builder()
|
||||
|
@ -136,7 +136,7 @@ public class DomainRestoreRequestFlowTest
|
|||
// 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);
|
||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntryDomainRestore =
|
||||
getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_RESTORE);
|
||||
assertThat(ofy().load().key(domain.getAutorenewBillingEvent()).now().getEventTime())
|
||||
|
@ -474,7 +474,7 @@ public class DomainRestoreRequestFlowTest
|
|||
@Test
|
||||
public void testFailure_notInRedemptionPeriod() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setDeletionTime(clock.nowUtc().plusDays(4))
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE))
|
||||
|
@ -611,7 +611,7 @@ public class DomainRestoreRequestFlowTest
|
|||
public void testIcannTransactionReportField_getsStored() throws Exception {
|
||||
persistPendingDeleteDomain();
|
||||
runFlow();
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntryDomainRestore =
|
||||
getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_RESTORE);
|
||||
assertThat(historyEntryDomainRestore.getDomainTransactionRecords())
|
||||
|
|
|
@ -30,7 +30,7 @@ import static google.registry.testing.DatastoreHelper.getOnlyPollMessage;
|
|||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.HistoryEntrySubject.assertAboutHistoryEntries;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -55,7 +55,7 @@ import google.registry.model.billing.BillingEvent.Reason;
|
|||
import google.registry.model.billing.BillingEvent.Recurring;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.Period.Unit;
|
||||
|
@ -81,7 +81,7 @@ import org.junit.Test;
|
|||
|
||||
/** Unit tests for {@link DomainTransferApproveFlow}. */
|
||||
public class DomainTransferApproveFlowTest
|
||||
extends DomainTransferFlowTestCase<DomainTransferApproveFlow, DomainResource> {
|
||||
extends DomainTransferFlowTestCase<DomainTransferApproveFlow, DomainBase> {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
@ -108,7 +108,7 @@ public class DomainTransferApproveFlowTest
|
|||
clock.advanceOneMilli();
|
||||
}
|
||||
|
||||
private void assertTransferApproved(DomainResource domain, TransferData oldTransferData) {
|
||||
private void assertTransferApproved(DomainBase domain, TransferData oldTransferData) {
|
||||
assertAboutDomains()
|
||||
.that(domain)
|
||||
.hasCurrentSponsorClientId("NewRegistrar")
|
||||
|
@ -633,7 +633,7 @@ public class DomainTransferApproveFlowTest
|
|||
@Test
|
||||
public void testSuccess_superuserExtension_transferPeriodZero_autorenewGraceActive()
|
||||
throws Exception {
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
Key<Recurring> existingAutorenewEvent = domain.getAutorenewBillingEvent();
|
||||
// Set domain to have auto-renewed just before the transfer request, so that it will have an
|
||||
// active autorenew grace period spanning the entire transfer window.
|
||||
|
|
|
@ -27,7 +27,7 @@ import static google.registry.testing.DatastoreHelper.getOnlyHistoryEntryOfType;
|
|||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.HistoryEntrySubject.assertAboutHistoryEntries;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -43,7 +43,7 @@ import google.registry.flows.exceptions.NotPendingTransferException;
|
|||
import google.registry.flows.exceptions.NotTransferInitiatorException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
|
@ -60,7 +60,7 @@ import org.junit.Test;
|
|||
|
||||
/** Unit tests for {@link DomainTransferCancelFlow}. */
|
||||
public class DomainTransferCancelFlowTest
|
||||
extends DomainTransferFlowTestCase<DomainTransferCancelFlow, DomainResource> {
|
||||
extends DomainTransferFlowTestCase<DomainTransferCancelFlow, DomainBase> {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
|
|
@ -24,7 +24,7 @@ import static google.registry.testing.DatastoreHelper.persistActiveContact;
|
|||
import static google.registry.testing.DatastoreHelper.persistDomainWithDependentResources;
|
||||
import static google.registry.testing.DatastoreHelper.persistDomainWithPendingTransfer;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
|
||||
import com.google.common.base.Ascii;
|
||||
|
@ -37,7 +37,7 @@ import google.registry.model.billing.BillingEvent;
|
|||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.registry.Registry;
|
||||
|
@ -72,7 +72,7 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
|||
REGISTRATION_EXPIRATION_TIME.plusYears(EXTENDED_REGISTRATION_YEARS);
|
||||
|
||||
protected ContactResource contact;
|
||||
protected DomainResource domain;
|
||||
protected DomainBase domain;
|
||||
protected HostResource subordinateHost;
|
||||
protected HistoryEntry historyEntryDomainCreate;
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
|||
AppEngineRule.makeRegistrar1().asBuilder().setClientId("ClientZ").build());
|
||||
}
|
||||
|
||||
static DomainResource persistWithPendingTransfer(DomainResource domain) {
|
||||
static DomainBase persistWithPendingTransfer(DomainBase domain) {
|
||||
return persistDomainWithPendingTransfer(
|
||||
domain,
|
||||
TRANSFER_REQUEST_TIME,
|
||||
|
@ -165,7 +165,7 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
|||
}
|
||||
|
||||
protected void assertTransferFailed(
|
||||
DomainResource domain, TransferStatus status, TransferData oldTransferData) {
|
||||
DomainBase domain, TransferStatus status, TransferData oldTransferData) {
|
||||
assertAboutDomains().that(domain)
|
||||
.doesNotHaveStatusValue(StatusValue.PENDING_TRANSFER).and()
|
||||
.hasCurrentSponsorClientId("TheRegistrar");
|
||||
|
|
|
@ -19,7 +19,7 @@ import static google.registry.testing.DatastoreHelper.assertBillingEvents;
|
|||
import static google.registry.testing.DatastoreHelper.deleteResource;
|
||||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import google.registry.flows.exceptions.NoTransferHistoryToQueryException;
|
|||
import google.registry.flows.exceptions.NotAuthorizedToViewTransferException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.transfer.TransferStatus;
|
||||
|
@ -39,7 +39,7 @@ import org.junit.Test;
|
|||
|
||||
/** Unit tests for {@link DomainTransferQueryFlow}. */
|
||||
public class DomainTransferQueryFlowTest
|
||||
extends DomainTransferFlowTestCase<DomainTransferQueryFlow, DomainResource> {
|
||||
extends DomainTransferFlowTestCase<DomainTransferQueryFlow, DomainBase> {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
|
|
@ -29,7 +29,7 @@ import static google.registry.testing.DatastoreHelper.getOnlyPollMessage;
|
|||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.HistoryEntrySubject.assertAboutHistoryEntries;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -44,7 +44,7 @@ import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException
|
|||
import google.registry.flows.exceptions.NotPendingTransferException;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
|
@ -63,7 +63,7 @@ import org.junit.Test;
|
|||
|
||||
/** Unit tests for {@link DomainTransferRejectFlow}. */
|
||||
public class DomainTransferRejectFlowTest
|
||||
extends DomainTransferFlowTestCase<DomainTransferRejectFlow, DomainResource> {
|
||||
extends DomainTransferFlowTestCase<DomainTransferRejectFlow, DomainBase> {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
|
|
@ -36,7 +36,7 @@ import static google.registry.testing.DatastoreHelper.getPollMessages;
|
|||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveContact;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.HistoryEntrySubject.assertAboutHistoryEntries;
|
||||
import static google.registry.testing.HostResourceSubject.assertAboutHosts;
|
||||
|
@ -80,7 +80,7 @@ import google.registry.model.billing.BillingEvent;
|
|||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.contact.ContactAuthInfo;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.Period.Unit;
|
||||
|
@ -110,7 +110,7 @@ import org.junit.Test;
|
|||
|
||||
/** Unit tests for {@link DomainTransferRequestFlow}. */
|
||||
public class DomainTransferRequestFlowTest
|
||||
extends DomainTransferFlowTestCase<DomainTransferRequestFlow, DomainResource> {
|
||||
extends DomainTransferFlowTestCase<DomainTransferRequestFlow, DomainBase> {
|
||||
|
||||
private static final ImmutableMap<String, String> BASE_FEE_MAP =
|
||||
new ImmutableMap.Builder<String, String>()
|
||||
|
@ -144,7 +144,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
private void assertTransferRequested(
|
||||
DomainResource domain,
|
||||
DomainBase domain,
|
||||
DateTime automaticTransferTime,
|
||||
Period expectedPeriod,
|
||||
DateTime expectedExpirationTime)
|
||||
|
@ -184,7 +184,7 @@ public class DomainTransferRequestFlowTest
|
|||
}
|
||||
|
||||
private void assertTransferApproved(
|
||||
DomainResource domain, DateTime automaticTransferTime, Period expectedPeriod)
|
||||
DomainBase domain, DateTime automaticTransferTime, Period expectedPeriod)
|
||||
throws Exception {
|
||||
assertAboutDomains()
|
||||
.that(domain)
|
||||
|
@ -309,7 +309,7 @@ public class DomainTransferRequestFlowTest
|
|||
assertThat(domain.getGracePeriods()).containsExactlyElementsIn(originalGracePeriods);
|
||||
// If we fast forward AUTOMATIC_TRANSFER_DAYS, the transfer should have cleared out all other
|
||||
// grace periods, but expect a transfer grace period (if there was a transfer billing event).
|
||||
DomainResource domainAfterAutomaticTransfer = domain.cloneProjectedAtTime(implicitTransferTime);
|
||||
DomainBase domainAfterAutomaticTransfer = domain.cloneProjectedAtTime(implicitTransferTime);
|
||||
if (expectTransferBillingEvent) {
|
||||
assertGracePeriods(
|
||||
domainAfterAutomaticTransfer.getGracePeriods(),
|
||||
|
@ -417,7 +417,7 @@ public class DomainTransferRequestFlowTest
|
|||
DateTime expectedExpirationTime, DateTime implicitTransferTime, Period expectedPeriod)
|
||||
throws Exception {
|
||||
Registry registry = Registry.get(domain.getTld());
|
||||
DomainResource domainAfterAutomaticTransfer = domain.cloneProjectedAtTime(implicitTransferTime);
|
||||
DomainBase domainAfterAutomaticTransfer = domain.cloneProjectedAtTime(implicitTransferTime);
|
||||
assertTransferApproved(domainAfterAutomaticTransfer, implicitTransferTime, expectedPeriod);
|
||||
assertAboutDomains()
|
||||
.that(domainAfterAutomaticTransfer)
|
||||
|
@ -434,7 +434,7 @@ public class DomainTransferRequestFlowTest
|
|||
.getEventTime())
|
||||
.isEqualTo(expectedExpirationTime);
|
||||
// And after the expected grace time, the grace period should be gone.
|
||||
DomainResource afterGracePeriod =
|
||||
DomainBase afterGracePeriod =
|
||||
domain.cloneProjectedAtTime(
|
||||
clock
|
||||
.nowUtc()
|
||||
|
@ -573,7 +573,7 @@ public class DomainTransferRequestFlowTest
|
|||
if (expectedAutomaticTransferLength.equals(Duration.ZERO)) {
|
||||
// The transfer is going to happen immediately. To observe the domain in the pending transfer
|
||||
// state, grab it directly from the database.
|
||||
domain = Iterables.getOnlyElement(ofy().load().type(DomainResource.class).list());
|
||||
domain = Iterables.getOnlyElement(ofy().load().type(DomainBase.class).list());
|
||||
assertThat(domain.getFullyQualifiedDomainName()).isEqualTo("example.tld");
|
||||
} else {
|
||||
// Transfer should have been requested.
|
||||
|
|
|
@ -25,7 +25,7 @@ import static google.registry.testing.DatastoreHelper.assertNoBillingEvents;
|
|||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.getOnlyHistoryEntryOfType;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainBase;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveContact;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
|
@ -33,7 +33,7 @@ import static google.registry.testing.DatastoreHelper.persistActiveSubordinateHo
|
|||
import static google.registry.testing.DatastoreHelper.persistDeletedDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistReservedList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DomainResourceSubject.assertAboutDomains;
|
||||
import static google.registry.testing.DomainBaseSubject.assertAboutDomains;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.HistoryEntrySubject.assertAboutHistoryEntries;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -83,7 +83,7 @@ import google.registry.model.billing.BillingEvent.Reason;
|
|||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -94,7 +94,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for {@link DomainUpdateFlow}. */
|
||||
public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, DomainResource> {
|
||||
public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, DomainBase> {
|
||||
|
||||
private static final DelegationSignerData SOME_DSDATA =
|
||||
DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2});
|
||||
|
@ -120,12 +120,12 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
unusedContact = persistActiveContact("unused");
|
||||
}
|
||||
|
||||
private DomainResource persistDomain() throws Exception {
|
||||
private DomainBase persistDomain() throws Exception {
|
||||
HostResource host =
|
||||
loadByForeignKey(HostResource.class, "ns1.example.foo", clock.nowUtc()).get();
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
ImmutableSet.of(
|
||||
|
@ -268,7 +268,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
clock.advanceOneMilli();
|
||||
assertTransactionalFlow(true);
|
||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
assertAboutDomains()
|
||||
.that(domain)
|
||||
.hasOneHistoryEntryEachOfTypes(
|
||||
|
@ -289,7 +289,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
persistReferencedEntities();
|
||||
persistDomain();
|
||||
runFlow();
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
DomainBase domain = reloadResourceByForeignKey();
|
||||
assertAboutDomains()
|
||||
.that(domain)
|
||||
.hasOneHistoryEntryEachOfTypes(
|
||||
|
@ -324,7 +324,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
// host relationship itself.
|
||||
setEppInput("domain_update_subordinate_hosts.xml");
|
||||
persistReferencedEntities();
|
||||
DomainResource domain = persistDomain();
|
||||
DomainBase domain = persistDomain();
|
||||
HostResource existingHost = persistActiveSubordinateHost("ns1.example.tld", domain);
|
||||
HostResource addedHost = persistActiveSubordinateHost("ns2.example.tld", domain);
|
||||
domain =
|
||||
|
@ -358,7 +358,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
ContactResource sh8013 =
|
||||
loadByForeignKey(ContactResource.class, "sh8013", clock.nowUtc()).get();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setRegistrant(Key.create(sh8013))
|
||||
.build());
|
||||
|
@ -374,7 +374,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
loadByForeignKey(ContactResource.class, "sh8013", clock.nowUtc()).get();
|
||||
Key<ContactResource> sh8013Key = Key.create(sh8013);
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setRegistrant(sh8013Key)
|
||||
.setContacts(
|
||||
|
@ -409,11 +409,11 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
throws Exception {
|
||||
setEppInput(xmlFilename);
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand()).asBuilder().setDsData(originalDsData).build());
|
||||
newDomainBase(getUniqueIdFromCommand()).asBuilder().setDsData(originalDsData).build());
|
||||
assertTransactionalFlow(true);
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||
DomainResource resource = reloadResourceByForeignKey();
|
||||
DomainBase resource = reloadResourceByForeignKey();
|
||||
assertAboutDomains()
|
||||
.that(resource)
|
||||
.hasOnlyOneHistoryEntryWhich()
|
||||
|
@ -572,7 +572,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
@Test
|
||||
public void testSuccess_noBillingOnPreExistingServerStatus() throws Exception {
|
||||
eppRequestSource = EppRequestSource.TOOL;
|
||||
DomainResource addStatusDomain = persistActiveDomain(getUniqueIdFromCommand());
|
||||
DomainBase addStatusDomain = persistActiveDomain(getUniqueIdFromCommand());
|
||||
persistResource(
|
||||
addStatusDomain.asBuilder().addStatusValue(StatusValue.SERVER_RENEW_PROHIBITED).build());
|
||||
doServerStatusBillingTest("domain_update_add_server_status.xml", false);
|
||||
|
@ -582,7 +582,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
public void testSuccess_removeServerStatusBillingEvent() throws Exception {
|
||||
eppRequestSource = EppRequestSource.TOOL;
|
||||
persistReferencedEntities();
|
||||
DomainResource removeStatusDomain = persistDomain();
|
||||
DomainBase removeStatusDomain = persistDomain();
|
||||
persistResource(
|
||||
removeStatusDomain.asBuilder().addStatusValue(StatusValue.SERVER_RENEW_PROHIBITED).build());
|
||||
doServerStatusBillingTest("domain_update_remove_server_status.xml", true);
|
||||
|
@ -592,7 +592,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
public void testSuccess_changeServerStatusBillingEvent() throws Exception {
|
||||
eppRequestSource = EppRequestSource.TOOL;
|
||||
persistReferencedEntities();
|
||||
DomainResource changeStatusDomain = persistDomain();
|
||||
DomainBase changeStatusDomain = persistDomain();
|
||||
persistResource(
|
||||
changeStatusDomain.asBuilder().addStatusValue(StatusValue.SERVER_RENEW_PROHIBITED).build());
|
||||
doServerStatusBillingTest("domain_update_change_server_status.xml", true);
|
||||
|
@ -676,7 +676,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
|
||||
setEppInput("domain_update_dsdata_add.xml");
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand()).asBuilder().setDsData(builder.build()).build());
|
||||
newDomainBase(getUniqueIdFromCommand()).asBuilder().setDsData(builder.build()).build());
|
||||
EppException thrown = assertThrows(TooManyDsRecordsException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
@ -782,7 +782,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
public void testFailure_serverUpdateProhibited_prohibitsNonSuperuserUpdates() throws Exception {
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.addStatusValue(SERVER_UPDATE_PROHIBITED)
|
||||
.build());
|
||||
|
@ -823,7 +823,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
setEppInput("domain_update_authinfo.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_UPDATE_PROHIBITED))
|
||||
.build());
|
||||
|
@ -836,7 +836,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
public void testFailure_serverUpdateProhibited() throws Exception {
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setStatusValues(ImmutableSet.of(SERVER_UPDATE_PROHIBITED))
|
||||
.build());
|
||||
|
@ -849,7 +849,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
public void testFailure_pendingDelete() throws Exception {
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setDeletionTime(clock.nowUtc().plusDays(1))
|
||||
.addStatusValue(StatusValue.PENDING_DELETE)
|
||||
|
@ -923,7 +923,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
setEppInput("domain_update_add_remove_same_host.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setNameservers(
|
||||
ImmutableSet.of(
|
||||
|
@ -940,7 +940,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
setEppInput("domain_update_add_remove_same_contact.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
DesignatedContact.create(
|
||||
|
@ -957,7 +957,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
setEppInput("domain_update_remove_admin.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
ImmutableSet.of(
|
||||
|
@ -973,7 +973,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
setEppInput("domain_update_remove_tech.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand())
|
||||
newDomainBase(getUniqueIdFromCommand())
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
ImmutableSet.of(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue