mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 08:52:12 +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
|
@ -37,7 +37,7 @@ import static google.registry.testing.DatastoreHelper.getOnlyHistoryEntryOfType;
|
|||
import static google.registry.testing.DatastoreHelper.getOnlyPollMessageForHistoryEntry;
|
||||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||
import static google.registry.testing.DatastoreHelper.newContactResource;
|
||||
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.persistActiveHost;
|
||||
|
@ -75,7 +75,7 @@ import google.registry.model.contact.ContactAddress;
|
|||
import google.registry.model.contact.ContactPhoneNumber;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.eppoutput.EppResponse.ResponseData;
|
||||
|
@ -96,7 +96,6 @@ import google.registry.testing.FakeClock;
|
|||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.FakeSleeper;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.MockitoJUnitRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import google.registry.testing.mapreduce.MapreduceTestCase;
|
||||
import google.registry.util.AppEngineServiceUtils;
|
||||
|
@ -120,7 +119,6 @@ public class DeleteContactsAndHostsActionTest
|
|||
extends MapreduceTestCase<DeleteContactsAndHostsAction> {
|
||||
|
||||
@Rule public final InjectRule inject = new InjectRule();
|
||||
@Rule public final MockitoJUnitRule mocks = MockitoJUnitRule.create();
|
||||
|
||||
private AsyncTaskEnqueuer enqueuer;
|
||||
private final FakeClock clock = new FakeClock(DateTime.parse("2015-01-15T11:22:33Z"));
|
||||
|
@ -181,7 +179,7 @@ public class DeleteContactsAndHostsActionTest
|
|||
@Test
|
||||
public void testSuccess_contact_referencedByActiveDomain_doesNotGetDeleted() throws Exception {
|
||||
ContactResource contact = persistContactPendingDelete("blah8221");
|
||||
persistResource(newDomainResource("example.tld", contact));
|
||||
persistResource(newDomainBase("example.tld", contact));
|
||||
DateTime timeEnqueued = clock.nowUtc();
|
||||
enqueuer.enqueueAsyncDelete(
|
||||
contact,
|
||||
|
@ -197,8 +195,8 @@ public class DeleteContactsAndHostsActionTest
|
|||
.doesNotHaveStatusValue(PENDING_DELETE)
|
||||
.and()
|
||||
.hasDeletionTime(END_OF_TIME);
|
||||
DomainResource domainReloaded =
|
||||
loadByForeignKey(DomainResource.class, "example.tld", clock.nowUtc()).get();
|
||||
DomainBase domainReloaded =
|
||||
loadByForeignKey(DomainBase.class, "example.tld", clock.nowUtc()).get();
|
||||
assertThat(domainReloaded.getReferencedContacts()).contains(Key.create(contactUpdated));
|
||||
HistoryEntry historyEntry =
|
||||
getOnlyHistoryEntryOfType(contactUpdated, HistoryEntry.Type.CONTACT_DELETE_FAILURE);
|
||||
|
@ -237,7 +235,7 @@ public class DeleteContactsAndHostsActionTest
|
|||
@Test
|
||||
public void test_mapreduceHasWorkToDo_lockIsAcquired() {
|
||||
ContactResource contact = persistContactPendingDelete("blah8221");
|
||||
persistResource(newDomainResource("example.tld", contact));
|
||||
persistResource(newDomainBase("example.tld", contact));
|
||||
DateTime timeEnqueued = clock.nowUtc();
|
||||
enqueuer.enqueueAsyncDelete(
|
||||
contact,
|
||||
|
@ -380,7 +378,7 @@ public class DeleteContactsAndHostsActionTest
|
|||
public void testSuccess_contact_referencedByDeletedDomain_getsDeleted() throws Exception {
|
||||
ContactResource contactUsed = persistContactPendingDelete("blah1234");
|
||||
persistResource(
|
||||
newDomainResource("example.tld", contactUsed)
|
||||
newDomainBase("example.tld", contactUsed)
|
||||
.asBuilder()
|
||||
.setDeletionTime(clock.nowUtc().minusDays(3))
|
||||
.build());
|
||||
|
@ -614,8 +612,8 @@ public class DeleteContactsAndHostsActionTest
|
|||
.doesNotHaveStatusValue(PENDING_DELETE)
|
||||
.and()
|
||||
.hasDeletionTime(END_OF_TIME);
|
||||
DomainResource domain =
|
||||
loadByForeignKey(DomainResource.class, "example.tld", clock.nowUtc()).get();
|
||||
DomainBase domain =
|
||||
loadByForeignKey(DomainBase.class, "example.tld", clock.nowUtc()).get();
|
||||
assertThat(domain.getNameservers()).contains(Key.create(hostAfter));
|
||||
HistoryEntry historyEntry = getOnlyHistoryEntryOfType(hostAfter, HOST_DELETE_FAILURE);
|
||||
assertPollMessageFor(
|
||||
|
@ -684,7 +682,7 @@ public class DeleteContactsAndHostsActionTest
|
|||
public void testSuccess_host_referencedByDeletedDomain_getsDeleted() throws Exception {
|
||||
HostResource host = persistHostPendingDelete("ns1.example.tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host)))
|
||||
.setDeletionTime(clock.nowUtc().minusDays(5))
|
||||
|
@ -722,9 +720,9 @@ public class DeleteContactsAndHostsActionTest
|
|||
|
||||
@Test
|
||||
public void testSuccess_subordinateHost_getsDeleted() throws Exception {
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of("ns2.example.tld"))
|
||||
.build());
|
||||
|
@ -745,7 +743,7 @@ public class DeleteContactsAndHostsActionTest
|
|||
assertThat(loadByForeignKey(HostResource.class, "ns2.example.tld", clock.nowUtc())).isEmpty();
|
||||
assertNoBillingEvents();
|
||||
assertThat(
|
||||
loadByForeignKey(DomainResource.class, "example.tld", clock.nowUtc())
|
||||
loadByForeignKey(DomainBase.class, "example.tld", clock.nowUtc())
|
||||
.get()
|
||||
.getSubordinateHosts())
|
||||
.isEmpty();
|
||||
|
@ -940,10 +938,10 @@ public class DeleteContactsAndHostsActionTest
|
|||
newHostResource(hostName).asBuilder().addStatusValue(PENDING_DELETE).build());
|
||||
}
|
||||
|
||||
private static DomainResource persistUsedDomain(
|
||||
private static DomainBase persistUsedDomain(
|
||||
String domainName, ContactResource contact, HostResource host) {
|
||||
return persistResource(
|
||||
newDomainResource(domainName, contact)
|
||||
newDomainBase(domainName, contact)
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host)))
|
||||
.build());
|
||||
|
|
|
@ -19,7 +19,7 @@ import static com.google.common.truth.Truth8.assertThat;
|
|||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
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.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedDomain;
|
||||
|
@ -38,7 +38,7 @@ import google.registry.config.RegistryEnvironment;
|
|||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.index.EppResourceIndex;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
|
@ -163,9 +163,9 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
|
||||
@Test
|
||||
public void testSuccess_doesntDeleteNicDomainForProbers() throws Exception {
|
||||
DomainResource nic = persistActiveDomain("nic.ib-any.test");
|
||||
ForeignKeyIndex<DomainResource> fkiNic =
|
||||
ForeignKeyIndex.load(DomainResource.class, "nic.ib-any.test", START_OF_TIME);
|
||||
DomainBase nic = persistActiveDomain("nic.ib-any.test");
|
||||
ForeignKeyIndex<DomainBase> fkiNic =
|
||||
ForeignKeyIndex.load(DomainBase.class, "nic.ib-any.test", START_OF_TIME);
|
||||
Set<ImmutableObject> ibEntities = persistLotsOfDomains("ib-any.test");
|
||||
runMapreduce();
|
||||
assertDeleted(ibEntities);
|
||||
|
@ -184,14 +184,14 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
|
||||
@Test
|
||||
public void testSuccess_activeDomain_isSoftDeleted() throws Exception {
|
||||
DomainResource domain = persistResource(
|
||||
newDomainResource("blah.ib-any.test")
|
||||
DomainBase domain = persistResource(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
runMapreduce();
|
||||
DateTime timeAfterDeletion = DateTime.now(UTC);
|
||||
assertThat(loadByForeignKey(DomainResource.class, "blah.ib-any.test", timeAfterDeletion))
|
||||
assertThat(loadByForeignKey(DomainBase.class, "blah.ib-any.test", timeAfterDeletion))
|
||||
.isEmpty();
|
||||
assertThat(ofy().load().entity(domain).now().getDeletionTime()).isLessThan(timeAfterDeletion);
|
||||
assertDnsTasksEnqueued("blah.ib-any.test");
|
||||
|
@ -199,8 +199,8 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
|
||||
@Test
|
||||
public void testSuccess_activeDomain_doubleMapSoftDeletes() throws Exception {
|
||||
DomainResource domain = persistResource(
|
||||
newDomainResource("blah.ib-any.test")
|
||||
DomainBase domain = persistResource(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
|
@ -208,7 +208,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
DateTime timeAfterDeletion = DateTime.now(UTC);
|
||||
resetAction();
|
||||
runMapreduce();
|
||||
assertThat(loadByForeignKey(DomainResource.class, "blah.ib-any.test", timeAfterDeletion))
|
||||
assertThat(loadByForeignKey(DomainBase.class, "blah.ib-any.test", timeAfterDeletion))
|
||||
.isEmpty();
|
||||
assertThat(ofy().load().entity(domain).now().getDeletionTime()).isLessThan(timeAfterDeletion);
|
||||
assertDnsTasksEnqueued("blah.ib-any.test");
|
||||
|
@ -217,21 +217,21 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
@Test
|
||||
public void test_recentlyCreatedDomain_isntDeletedYet() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource("blah.ib-any.test")
|
||||
newDomainBase("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusSeconds(1))
|
||||
.build());
|
||||
runMapreduce();
|
||||
Optional<DomainResource> domain =
|
||||
loadByForeignKey(DomainResource.class, "blah.ib-any.test", DateTime.now(UTC));
|
||||
Optional<DomainBase> domain =
|
||||
loadByForeignKey(DomainBase.class, "blah.ib-any.test", DateTime.now(UTC));
|
||||
assertThat(domain).isPresent();
|
||||
assertThat(domain.get().getDeletionTime()).isEqualTo(END_OF_TIME);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDryRun_doesntSoftDeleteData() throws Exception {
|
||||
DomainResource domain = persistResource(
|
||||
newDomainResource("blah.ib-any.test")
|
||||
DomainBase domain = persistResource(
|
||||
newDomainBase("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
|
@ -243,11 +243,11 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
@Test
|
||||
public void test_domainWithSubordinateHosts_isSkipped() throws Exception {
|
||||
persistActiveHost("ns1.blah.ib-any.test");
|
||||
DomainResource nakedDomain =
|
||||
DomainBase nakedDomain =
|
||||
persistDeletedDomain("todelete.ib-any.test", DateTime.now(UTC).minusYears(1));
|
||||
DomainResource domainWithSubord =
|
||||
DomainBase domainWithSubord =
|
||||
persistDomainAsDeleted(
|
||||
newDomainResource("blah.ib-any.test")
|
||||
newDomainBase("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of("ns1.blah.ib-any.test"))
|
||||
.build(),
|
||||
|
@ -260,7 +260,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
@Test
|
||||
public void testFailure_registryAdminClientId_isRequiredForSoftDeletion() {
|
||||
persistResource(
|
||||
newDomainResource("blah.ib-any.test")
|
||||
newDomainBase("blah.ib-any.test")
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(DateTime.now(UTC).minusYears(1))
|
||||
.build());
|
||||
|
@ -274,7 +274,7 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
* along with the ForeignKeyIndex and EppResourceIndex.
|
||||
*/
|
||||
private static Set<ImmutableObject> persistDomainAndDescendants(String fqdn) {
|
||||
DomainResource domain = persistDeletedDomain(fqdn, DELETION_TIME);
|
||||
DomainBase domain = persistDeletedDomain(fqdn, DELETION_TIME);
|
||||
HistoryEntry historyEntry = persistSimpleResource(
|
||||
new HistoryEntry.Builder()
|
||||
.setParent(domain)
|
||||
|
@ -298,8 +298,8 @@ public class DeleteProberDataActionTest extends MapreduceTestCase<DeleteProberDa
|
|||
.setClientId("TheRegistrar")
|
||||
.setMsg("Domain registered")
|
||||
.build());
|
||||
ForeignKeyIndex<DomainResource> fki =
|
||||
ForeignKeyIndex.load(DomainResource.class, fqdn, START_OF_TIME);
|
||||
ForeignKeyIndex<DomainBase> fki =
|
||||
ForeignKeyIndex.load(DomainBase.class, fqdn, START_OF_TIME);
|
||||
EppResourceIndex eppIndex =
|
||||
ofy().load().entity(EppResourceIndex.create(Key.create(domain))).now();
|
||||
return ImmutableSet.of(
|
||||
|
|
|
@ -42,7 +42,7 @@ import google.registry.model.billing.BillingEvent.Flag;
|
|||
import google.registry.model.billing.BillingEvent.OneTime;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.common.Cursor;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.registry.Registry;
|
||||
|
@ -74,7 +74,7 @@ public class ExpandRecurringBillingEventsActionTest
|
|||
private final DateTime beginningOfTest = DateTime.parse("2000-10-02T00:00:00Z");
|
||||
private final FakeClock clock = new FakeClock(beginningOfTest);
|
||||
|
||||
DomainResource domain;
|
||||
DomainBase domain;
|
||||
HistoryEntry historyEntry;
|
||||
BillingEvent.Recurring recurring;
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class ExpandRecurringBillingEventsActionTest
|
|||
}
|
||||
|
||||
void assertHistoryEntryMatches(
|
||||
DomainResource domain, HistoryEntry actual, String clientId, DateTime billingTime) {
|
||||
DomainBase domain, HistoryEntry actual, String clientId, DateTime billingTime) {
|
||||
assertThat(actual.getBySuperuser()).isFalse();
|
||||
assertThat(actual.getClientId()).isEqualTo(clientId);
|
||||
assertThat(actual.getParent()).isEqualTo(Key.create(domain));
|
||||
|
@ -168,7 +168,7 @@ public class ExpandRecurringBillingEventsActionTest
|
|||
@Test
|
||||
public void testSuccess_expandSingleEvent_deletedDomain() throws Exception {
|
||||
DateTime deletionTime = DateTime.parse("2000-08-01T00:00:00Z");
|
||||
DomainResource deletedDomain = persistDeletedDomain("deleted.tld", deletionTime);
|
||||
DomainBase deletedDomain = persistDeletedDomain("deleted.tld", deletionTime);
|
||||
historyEntry = persistResource(new HistoryEntry.Builder().setParent(deletedDomain).build());
|
||||
recurring = persistResource(new BillingEvent.Recurring.Builder()
|
||||
.setParent(historyEntry)
|
||||
|
|
|
@ -23,7 +23,7 @@ import static google.registry.batch.AsyncTaskEnqueuer.QUEUE_ASYNC_HOST_RENAME;
|
|||
import static google.registry.batch.AsyncTaskMetrics.OperationType.DNS_REFRESH;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
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.newHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedHost;
|
||||
|
@ -53,7 +53,6 @@ import google.registry.testing.FakeClock;
|
|||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.FakeSleeper;
|
||||
import google.registry.testing.InjectRule;
|
||||
import google.registry.testing.MockitoJUnitRule;
|
||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||
import google.registry.testing.mapreduce.MapreduceTestCase;
|
||||
import google.registry.util.AppEngineServiceUtils;
|
||||
|
@ -77,7 +76,6 @@ public class RefreshDnsOnHostRenameActionTest
|
|||
extends MapreduceTestCase<RefreshDnsOnHostRenameAction> {
|
||||
|
||||
@Rule public final InjectRule inject = new InjectRule();
|
||||
@Rule public final MockitoJUnitRule mocks = MockitoJUnitRule.create();
|
||||
|
||||
private AsyncTaskEnqueuer enqueuer;
|
||||
private final FakeClock clock = new FakeClock(DateTime.parse("2015-01-15T11:22:33Z"));
|
||||
|
@ -135,9 +133,9 @@ public class RefreshDnsOnHostRenameActionTest
|
|||
@Test
|
||||
public void testSuccess_dnsUpdateEnqueued() throws Exception {
|
||||
HostResource host = persistActiveHost("ns1.example.tld");
|
||||
persistResource(newDomainResource("example.tld", host));
|
||||
persistResource(newDomainResource("otherexample.tld", host));
|
||||
persistResource(newDomainResource("untouched.tld", persistActiveHost("ns2.example.tld")));
|
||||
persistResource(newDomainBase("example.tld", host));
|
||||
persistResource(newDomainBase("otherexample.tld", host));
|
||||
persistResource(newDomainBase("untouched.tld", persistActiveHost("ns2.example.tld")));
|
||||
DateTime timeEnqueued = clock.nowUtc();
|
||||
enqueuer.enqueueAsyncDnsRefresh(host, timeEnqueued);
|
||||
runMapreduce();
|
||||
|
@ -154,9 +152,9 @@ public class RefreshDnsOnHostRenameActionTest
|
|||
HostResource host1 = persistActiveHost("ns1.example.tld");
|
||||
HostResource host2 = persistActiveHost("ns2.example.tld");
|
||||
HostResource host3 = persistActiveHost("ns3.example.tld");
|
||||
persistResource(newDomainResource("example1.tld", host1));
|
||||
persistResource(newDomainResource("example2.tld", host2));
|
||||
persistResource(newDomainResource("example3.tld", host3));
|
||||
persistResource(newDomainBase("example1.tld", host1));
|
||||
persistResource(newDomainBase("example2.tld", host2));
|
||||
persistResource(newDomainBase("example3.tld", host3));
|
||||
DateTime timeEnqueued = clock.nowUtc();
|
||||
DateTime laterTimeEnqueued = timeEnqueued.plus(standardSeconds(10));
|
||||
enqueuer.enqueueAsyncDnsRefresh(host1, timeEnqueued);
|
||||
|
@ -176,7 +174,7 @@ public class RefreshDnsOnHostRenameActionTest
|
|||
@Test
|
||||
public void testSuccess_deletedHost_doesntTriggerDnsRefresh() throws Exception {
|
||||
HostResource host = persistDeletedHost("ns11.fakesss.tld", clock.nowUtc().minusDays(4));
|
||||
persistResource(newDomainResource("example1.tld", host));
|
||||
persistResource(newDomainBase("example1.tld", host));
|
||||
DateTime timeEnqueued = clock.nowUtc();
|
||||
enqueuer.enqueueAsyncDnsRefresh(host, timeEnqueued);
|
||||
runMapreduce();
|
||||
|
@ -192,7 +190,7 @@ public class RefreshDnsOnHostRenameActionTest
|
|||
public void testSuccess_noDnsTasksForDeletedDomain() throws Exception {
|
||||
HostResource renamedHost = persistActiveHost("ns1.example.tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld", renamedHost)
|
||||
newDomainBase("example.tld", renamedHost)
|
||||
.asBuilder()
|
||||
.setDeletionTime(START_OF_TIME)
|
||||
.build());
|
||||
|
|
|
@ -24,7 +24,7 @@ import static google.registry.batch.AsyncTaskEnqueuer.QUEUE_ASYNC_DELETE;
|
|||
import static google.registry.batch.AsyncTaskEnqueuer.QUEUE_ASYNC_HOST_RENAME;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
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.persistDomainWithDependentResources;
|
||||
import static google.registry.testing.DatastoreHelper.persistDomainWithPendingTransfer;
|
||||
|
@ -39,7 +39,7 @@ import com.google.common.collect.ImmutableSet;
|
|||
import com.google.common.collect.ImmutableSortedSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.ImmutableObject;
|
||||
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;
|
||||
|
@ -106,7 +106,7 @@ public class ResaveEntityActionTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void test_domainPendingTransfer_isResavedAndTransferCompleted() {
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistDomainWithPendingTransfer(
|
||||
persistDomainWithDependentResources(
|
||||
"domain",
|
||||
|
@ -122,16 +122,16 @@ public class ResaveEntityActionTest extends ShardableTestCase {
|
|||
clock.advanceOneMilli();
|
||||
assertThat(domain.getCurrentSponsorClientId()).isEqualTo("TheRegistrar");
|
||||
runAction(Key.create(domain), DateTime.parse("2016-02-06T10:00:01Z"), ImmutableSortedSet.of());
|
||||
DomainResource resavedDomain = ofy().load().entity(domain).now();
|
||||
DomainBase resavedDomain = ofy().load().entity(domain).now();
|
||||
assertThat(resavedDomain.getCurrentSponsorClientId()).isEqualTo("NewRegistrar");
|
||||
verify(response).setPayload("Entity re-saved.");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_domainPendingDeletion_isResavedAndReenqueued() {
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("domain.tld")
|
||||
newDomainBase("domain.tld")
|
||||
.asBuilder()
|
||||
.setDeletionTime(clock.nowUtc().plusDays(35))
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE))
|
||||
|
@ -147,7 +147,7 @@ public class ResaveEntityActionTest extends ShardableTestCase {
|
|||
|
||||
assertThat(domain.getGracePeriods()).isNotEmpty();
|
||||
runAction(Key.create(domain), requestedTime, ImmutableSortedSet.of(requestedTime.plusDays(5)));
|
||||
DomainResource resavedDomain = ofy().load().entity(domain).now();
|
||||
DomainBase resavedDomain = ofy().load().entity(domain).now();
|
||||
assertThat(resavedDomain.getGracePeriods()).isEmpty();
|
||||
|
||||
assertTasksEnqueued(
|
||||
|
|
|
@ -33,7 +33,7 @@ import google.registry.dns.DnsMetrics.ActionStatus;
|
|||
import google.registry.dns.DnsMetrics.CommitStatus;
|
||||
import google.registry.dns.DnsMetrics.PublishStatus;
|
||||
import google.registry.dns.writer.DnsWriter;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.request.HttpException.ServiceUnavailableException;
|
||||
|
@ -78,10 +78,10 @@ public class PublishDnsUpdatesActionTest {
|
|||
.asBuilder()
|
||||
.setDnsWriters(ImmutableSet.of("correctWriter"))
|
||||
.build());
|
||||
DomainResource domain1 = persistActiveDomain("example.xn--q9jyb4c");
|
||||
DomainBase domain1 = persistActiveDomain("example.xn--q9jyb4c");
|
||||
persistActiveSubordinateHost("ns1.example.xn--q9jyb4c", domain1);
|
||||
persistActiveSubordinateHost("ns2.example.xn--q9jyb4c", domain1);
|
||||
DomainResource domain2 = persistActiveDomain("example2.xn--q9jyb4c");
|
||||
DomainBase domain2 = persistActiveDomain("example2.xn--q9jyb4c");
|
||||
persistActiveSubordinateHost("ns1.example.xn--q9jyb4c", domain2);
|
||||
clock.advanceOneMilli();
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import static org.mockito.Mockito.verify;
|
|||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
|
||||
import google.registry.dns.DnsConstants.TargetType;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.request.HttpException.NotFoundException;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
|
@ -64,7 +64,7 @@ public class RefreshDnsActionTest {
|
|||
|
||||
@Test
|
||||
public void testSuccess_host() {
|
||||
DomainResource domain = persistActiveDomain("example.xn--q9jyb4c");
|
||||
DomainBase domain = persistActiveDomain("example.xn--q9jyb4c");
|
||||
persistActiveSubordinateHost("ns1.example.xn--q9jyb4c", domain);
|
||||
run(TargetType.HOST, "ns1.example.xn--q9jyb4c");
|
||||
verify(dnsQueue).addHostRefreshTask("ns1.example.xn--q9jyb4c");
|
||||
|
|
|
@ -18,7 +18,7 @@ import static com.google.common.collect.ImmutableList.toImmutableList;
|
|||
import static com.google.common.io.BaseEncoding.base16;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
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.newHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
|
@ -40,7 +40,7 @@ import com.google.common.net.InetAddresses;
|
|||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.dns.writer.clouddns.CloudDnsWriter.ZoneStateException;
|
||||
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;
|
||||
|
@ -281,7 +281,7 @@ public class CloudDnsWriterTest {
|
|||
}
|
||||
|
||||
/** Returns a domain to be persisted in Datastore. */
|
||||
private static DomainResource fakeDomain(
|
||||
private static DomainBase fakeDomain(
|
||||
String domainName, ImmutableSet<HostResource> nameservers, int numDsRecords) {
|
||||
ImmutableSet.Builder<DelegationSignerData> dsDataBuilder = new ImmutableSet.Builder<>();
|
||||
|
||||
|
@ -294,7 +294,7 @@ public class CloudDnsWriterTest {
|
|||
hostResourceRefBuilder.add(Key.create(nameserver));
|
||||
}
|
||||
|
||||
return newDomainResource(domainName)
|
||||
return newDomainBase(domainName)
|
||||
.asBuilder()
|
||||
.setNameservers(hostResourceRefBuilder.build())
|
||||
.setDsData(dsDataBuilder.build())
|
||||
|
|
|
@ -18,7 +18,7 @@ import static com.google.common.io.BaseEncoding.base16;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assert_;
|
||||
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.newHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
|
@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import com.googlecode.objectify.Key;
|
||||
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;
|
||||
|
@ -102,7 +102,7 @@ public class DnsUpdateWriterTest {
|
|||
public void testPublishDomainCreate_publishesNameServers() throws Exception {
|
||||
HostResource host1 = persistActiveHost("ns1.example.tld");
|
||||
HostResource host2 = persistActiveHost("ns2.example.tld");
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistActiveDomain("example.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host1), Key.create(host2)))
|
||||
|
@ -123,7 +123,7 @@ public class DnsUpdateWriterTest {
|
|||
@Test
|
||||
public void testPublishAtomic_noCommit() {
|
||||
HostResource host1 = persistActiveHost("ns.example1.tld");
|
||||
DomainResource domain1 =
|
||||
DomainBase domain1 =
|
||||
persistActiveDomain("example1.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host1)))
|
||||
|
@ -131,7 +131,7 @@ public class DnsUpdateWriterTest {
|
|||
persistResource(domain1);
|
||||
|
||||
HostResource host2 = persistActiveHost("ns.example2.tld");
|
||||
DomainResource domain2 =
|
||||
DomainBase domain2 =
|
||||
persistActiveDomain("example2.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host2)))
|
||||
|
@ -147,7 +147,7 @@ public class DnsUpdateWriterTest {
|
|||
@Test
|
||||
public void testPublishAtomic_oneUpdate() throws Exception {
|
||||
HostResource host1 = persistActiveHost("ns.example1.tld");
|
||||
DomainResource domain1 =
|
||||
DomainBase domain1 =
|
||||
persistActiveDomain("example1.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host1)))
|
||||
|
@ -155,7 +155,7 @@ public class DnsUpdateWriterTest {
|
|||
persistResource(domain1);
|
||||
|
||||
HostResource host2 = persistActiveHost("ns.example2.tld");
|
||||
DomainResource domain2 =
|
||||
DomainBase domain2 =
|
||||
persistActiveDomain("example2.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host2)))
|
||||
|
@ -178,7 +178,7 @@ public class DnsUpdateWriterTest {
|
|||
|
||||
@Test
|
||||
public void testPublishDomainCreate_publishesDelegationSigner() throws Exception {
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistActiveDomain("example.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(persistActiveHost("ns1.example.tld"))))
|
||||
|
@ -202,7 +202,7 @@ public class DnsUpdateWriterTest {
|
|||
|
||||
@Test
|
||||
public void testPublishDomainWhenNotActive_removesDnsRecords() throws Exception {
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistActiveDomain("example.tld")
|
||||
.asBuilder()
|
||||
.addStatusValue(StatusValue.SERVER_HOLD)
|
||||
|
@ -247,7 +247,7 @@ public class DnsUpdateWriterTest {
|
|||
InetAddresses.forString("fd0e:a5c8:6dfb:6a5e:0:0:0:1")))
|
||||
.build());
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.addSubordinateHost("ns1.example.tld")
|
||||
.addNameserver(Key.create(host))
|
||||
|
@ -319,7 +319,7 @@ public class DnsUpdateWriterTest {
|
|||
.build());
|
||||
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.addSubordinateHost("ns1.example.tld")
|
||||
.addNameservers(
|
||||
|
@ -354,7 +354,7 @@ public class DnsUpdateWriterTest {
|
|||
.build());
|
||||
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.addSubordinateHost("ns1.example.tld")
|
||||
.addSubordinateHost("foo.example.tld")
|
||||
|
@ -378,7 +378,7 @@ public class DnsUpdateWriterTest {
|
|||
|
||||
@Test
|
||||
public void testPublishDomainFails_whenDnsUpdateReturnsError() throws Exception {
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistActiveDomain("example.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(persistActiveHost("ns1.example.tld"))))
|
||||
|
|
|
@ -27,7 +27,7 @@ import static org.joda.time.Duration.standardDays;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppTestComponent.FakesAndMocksModule;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.monitoring.whitebox.EppMetric;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
|
@ -104,8 +104,8 @@ public class EppCommitLogsTest extends ShardableTestCase {
|
|||
eppLoader = new EppLoader(this, "domain_create.xml", ImmutableMap.of("DOMAIN", "example.tld"));
|
||||
runFlow();
|
||||
ofy().clearSessionCache();
|
||||
Key<DomainResource> key = Key.create(ofy().load().type(DomainResource.class).first().now());
|
||||
DomainResource domainAfterCreate = ofy().load().key(key).now();
|
||||
Key<DomainBase> key = Key.create(ofy().load().type(DomainBase.class).first().now());
|
||||
DomainBase domainAfterCreate = ofy().load().key(key).now();
|
||||
assertThat(domainAfterCreate.getFullyQualifiedDomainName()).isEqualTo("example.tld");
|
||||
|
||||
clock.advanceBy(standardDays(2));
|
||||
|
@ -114,7 +114,7 @@ public class EppCommitLogsTest extends ShardableTestCase {
|
|||
runFlow();
|
||||
ofy().clearSessionCache();
|
||||
|
||||
DomainResource domainAfterFirstUpdate = ofy().load().key(key).now();
|
||||
DomainBase domainAfterFirstUpdate = ofy().load().key(key).now();
|
||||
assertThat(domainAfterCreate).isNotEqualTo(domainAfterFirstUpdate);
|
||||
|
||||
clock.advanceOneMilli(); // same day as first update
|
||||
|
@ -122,7 +122,7 @@ public class EppCommitLogsTest extends ShardableTestCase {
|
|||
eppLoader = new EppLoader(this, "domain_update_dsdata_rem.xml");
|
||||
runFlow();
|
||||
ofy().clearSessionCache();
|
||||
DomainResource domainAfterSecondUpdate = ofy().load().key(key).now();
|
||||
DomainBase domainAfterSecondUpdate = ofy().load().key(key).now();
|
||||
|
||||
clock.advanceBy(standardDays(2));
|
||||
DateTime timeAtDelete = clock.nowUtc(); // before 'add' grace period ends
|
||||
|
@ -133,7 +133,7 @@ public class EppCommitLogsTest extends ShardableTestCase {
|
|||
assertThat(domainAfterFirstUpdate).isNotEqualTo(domainAfterSecondUpdate);
|
||||
|
||||
// Point-in-time can only rewind an object from the current version, not roll forward.
|
||||
DomainResource latest = ofy().load().key(key).now();
|
||||
DomainBase latest = ofy().load().key(key).now();
|
||||
|
||||
// Creation time has millisecond granularity due to isActive() check.
|
||||
ofy().clearSessionCache();
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.google.re2j.Pattern;
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.OneTime;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
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 google.registry.model.reporting.HistoryEntry.Type;
|
||||
|
@ -110,8 +110,8 @@ public class EppLifecycleDomainTest extends EppTestCase {
|
|||
"CRDATE", "2000-06-01T00:02:00.0Z",
|
||||
"EXDATE", "2002-06-01T00:02:00.0Z"));
|
||||
|
||||
DomainResource domain =
|
||||
loadByForeignKey(DomainResource.class, "example.tld", createTime.plusHours(1)).get();
|
||||
DomainBase domain =
|
||||
loadByForeignKey(DomainBase.class, "example.tld", createTime.plusHours(1)).get();
|
||||
|
||||
// Delete domain example.tld within the add grace period.
|
||||
DateTime deleteTime = createTime.plusDays(1);
|
||||
|
@ -186,9 +186,9 @@ public class EppLifecycleDomainTest extends EppTestCase {
|
|||
ImmutableMap.of(
|
||||
"CODE", "2303", "MSG", "The domain with given ID (example.tld) doesn't exist."));
|
||||
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
loadByForeignKey(
|
||||
DomainResource.class, "example.tld", DateTime.parse("2000-08-01T00:02:00Z"))
|
||||
DomainBase.class, "example.tld", DateTime.parse("2000-08-01T00:02:00Z"))
|
||||
.get();
|
||||
// Verify that the autorenew was ended and that the one-time billing event is not canceled.
|
||||
assertBillingEventsForResource(
|
||||
|
@ -221,9 +221,9 @@ public class EppLifecycleDomainTest extends EppTestCase {
|
|||
.atTime(createTime)
|
||||
.hasResponse("domain_create_response_eap_fee.xml");
|
||||
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
loadByForeignKey(
|
||||
DomainResource.class, "example.tld", DateTime.parse("2000-06-01T00:03:00Z"))
|
||||
DomainBase.class, "example.tld", DateTime.parse("2000-06-01T00:03:00Z"))
|
||||
.get();
|
||||
|
||||
// Delete domain example.tld within the add grade period.
|
||||
|
|
|
@ -25,7 +25,7 @@ import static google.registry.testing.HostResourceSubject.assertAboutHosts;
|
|||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -219,8 +219,8 @@ public class EppLifecycleHostTest extends EppTestCase {
|
|||
|
||||
HostResource exampleBarFooTldHost =
|
||||
loadByForeignKey(HostResource.class, "ns1.example.bar.foo.tld", timeAfterCreates).get();
|
||||
DomainResource exampleBarFooTldDomain =
|
||||
loadByForeignKey(DomainResource.class, "example.bar.foo.tld", timeAfterCreates).get();
|
||||
DomainBase exampleBarFooTldDomain =
|
||||
loadByForeignKey(DomainBase.class, "example.bar.foo.tld", timeAfterCreates).get();
|
||||
assertAboutHosts()
|
||||
.that(exampleBarFooTldHost)
|
||||
.hasSuperordinateDomain(Key.create(exampleBarFooTldDomain));
|
||||
|
@ -229,8 +229,8 @@ public class EppLifecycleHostTest extends EppTestCase {
|
|||
|
||||
HostResource exampleFooTldHost =
|
||||
loadByForeignKey(HostResource.class, "ns1.example.foo.tld", timeAfterCreates).get();
|
||||
DomainResource exampleFooTldDomain =
|
||||
loadByForeignKey(DomainResource.class, "example.foo.tld", timeAfterCreates).get();
|
||||
DomainBase exampleFooTldDomain =
|
||||
loadByForeignKey(DomainBase.class, "example.foo.tld", timeAfterCreates).get();
|
||||
assertAboutHosts()
|
||||
.that(exampleFooTldHost)
|
||||
.hasSuperordinateDomain(Key.create(exampleFooTldDomain));
|
||||
|
@ -238,8 +238,8 @@ public class EppLifecycleHostTest extends EppTestCase {
|
|||
|
||||
HostResource exampleTldHost =
|
||||
loadByForeignKey(HostResource.class, "ns1.example.tld", timeAfterCreates).get();
|
||||
DomainResource exampleTldDomain =
|
||||
loadByForeignKey(DomainResource.class, "example.tld", timeAfterCreates).get();
|
||||
DomainBase exampleTldDomain =
|
||||
loadByForeignKey(DomainBase.class, "example.tld", timeAfterCreates).get();
|
||||
assertAboutHosts().that(exampleTldHost).hasSuperordinateDomain(Key.create(exampleTldDomain));
|
||||
assertThat(exampleTldDomain.getSubordinateHosts()).containsExactly("ns1.example.tld");
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import google.registry.model.billing.BillingEvent;
|
|||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.OneTime;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.EppXmlTransformer;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.registry.Registry;
|
||||
|
@ -276,7 +276,7 @@ public class EppTestCase extends ShardableTestCase {
|
|||
|
||||
/** Makes a one-time billing event corresponding to the given domain's creation. */
|
||||
protected static BillingEvent.OneTime makeOneTimeCreateBillingEvent(
|
||||
DomainResource domain, DateTime createTime) {
|
||||
DomainBase domain, DateTime createTime) {
|
||||
return new BillingEvent.OneTime.Builder()
|
||||
.setReason(Reason.CREATE)
|
||||
.setTargetId(domain.getFullyQualifiedDomainName())
|
||||
|
@ -291,14 +291,14 @@ public class EppTestCase extends ShardableTestCase {
|
|||
|
||||
/** Makes a recurring billing event corresponding to the given domain's creation. */
|
||||
protected static BillingEvent.Recurring makeRecurringCreateBillingEvent(
|
||||
DomainResource domain, DateTime eventTime, DateTime endTime) {
|
||||
DomainBase domain, DateTime eventTime, DateTime endTime) {
|
||||
return makeRecurringCreateBillingEvent(
|
||||
domain, getOnlyHistoryEntryOfType(domain, Type.DOMAIN_CREATE), eventTime, endTime);
|
||||
}
|
||||
|
||||
/** Makes a recurring billing event corresponding to the given history entry. */
|
||||
protected static BillingEvent.Recurring makeRecurringCreateBillingEvent(
|
||||
DomainResource domain, HistoryEntry historyEntry, DateTime eventTime, DateTime endTime) {
|
||||
DomainBase domain, HistoryEntry historyEntry, DateTime eventTime, DateTime endTime) {
|
||||
return new BillingEvent.Recurring.Builder()
|
||||
.setReason(Reason.RENEW)
|
||||
.setFlags(ImmutableSet.of(Flag.AUTO_RENEW))
|
||||
|
@ -312,7 +312,7 @@ public class EppTestCase extends ShardableTestCase {
|
|||
|
||||
/** Makes a cancellation billing event cancelling out the given domain create billing event. */
|
||||
protected static BillingEvent.Cancellation makeCancellationBillingEventFor(
|
||||
DomainResource domain,
|
||||
DomainBase domain,
|
||||
OneTime billingEventToCancel,
|
||||
DateTime createTime,
|
||||
DateTime deleteTime) {
|
||||
|
|
|
@ -76,7 +76,7 @@ public class FlowReporterTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testRecordToLogs_metadata_basic() throws Exception {
|
||||
when(flowReporter.eppInput.isDomainResourceType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.isDomainType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.getResourceType()).thenReturn(Optional.of("domain"));
|
||||
flowReporter.recordToLogs();
|
||||
assertThat(parseJsonMap(findFirstLogMessageByPrefix(handler, "FLOW-LOG-SIGNATURE-METADATA: ")))
|
||||
|
@ -114,7 +114,7 @@ public class FlowReporterTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testRecordToLogs_metadata_notResourceFlow_noResourceTypeOrTld() throws Exception {
|
||||
when(flowReporter.eppInput.isDomainResourceType()).thenReturn(false);
|
||||
when(flowReporter.eppInput.isDomainType()).thenReturn(false);
|
||||
when(flowReporter.eppInput.getResourceType()).thenReturn(Optional.empty());
|
||||
flowReporter.recordToLogs();
|
||||
Map<String, Object> json =
|
||||
|
@ -127,7 +127,7 @@ public class FlowReporterTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testRecordToLogs_metadata_notDomainFlow_noTld() throws Exception {
|
||||
when(flowReporter.eppInput.isDomainResourceType()).thenReturn(false);
|
||||
when(flowReporter.eppInput.isDomainType()).thenReturn(false);
|
||||
when(flowReporter.eppInput.getResourceType()).thenReturn(Optional.of("contact"));
|
||||
flowReporter.recordToLogs();
|
||||
Map<String, Object> json =
|
||||
|
@ -139,7 +139,7 @@ public class FlowReporterTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testRecordToLogs_metadata_multipartDomainName_multipartTld() throws Exception {
|
||||
when(flowReporter.eppInput.isDomainResourceType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.isDomainType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.getResourceType()).thenReturn(Optional.of("domain"));
|
||||
when(flowReporter.eppInput.getSingleTargetId()).thenReturn(Optional.of("target.co.uk"));
|
||||
when(flowReporter.eppInput.getTargetIds()).thenReturn(ImmutableList.of("target.co.uk"));
|
||||
|
@ -154,7 +154,7 @@ public class FlowReporterTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testRecordToLogs_metadata_multipleTargetIds_uniqueTldSet() throws Exception {
|
||||
when(flowReporter.eppInput.isDomainResourceType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.isDomainType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.getSingleTargetId()).thenReturn(Optional.empty());
|
||||
when(flowReporter.eppInput.getTargetIds())
|
||||
.thenReturn(ImmutableList.of("target.co.uk", "foo.uk", "bar.uk", "baz.com"));
|
||||
|
@ -170,7 +170,7 @@ public class FlowReporterTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testRecordToLogs_metadata_uppercaseDomainName_lowercaseTld() throws Exception {
|
||||
when(flowReporter.eppInput.isDomainResourceType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.isDomainType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.getSingleTargetId()).thenReturn(Optional.of("TARGET.FOO"));
|
||||
when(flowReporter.eppInput.getTargetIds()).thenReturn(ImmutableList.of("TARGET.FOO"));
|
||||
flowReporter.recordToLogs();
|
||||
|
@ -184,7 +184,7 @@ public class FlowReporterTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testRecordToLogs_metadata_invalidDomainName_stillGuessesTld() throws Exception {
|
||||
when(flowReporter.eppInput.isDomainResourceType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.isDomainType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.getSingleTargetId()).thenReturn(Optional.of("<foo@bar.com>"));
|
||||
when(flowReporter.eppInput.getTargetIds()).thenReturn(ImmutableList.of("<foo@bar.com>"));
|
||||
flowReporter.recordToLogs();
|
||||
|
@ -198,7 +198,7 @@ public class FlowReporterTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testRecordToLogs_metadata_domainWithoutPeriod_noTld() throws Exception {
|
||||
when(flowReporter.eppInput.isDomainResourceType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.isDomainType()).thenReturn(true);
|
||||
when(flowReporter.eppInput.getSingleTargetId()).thenReturn(Optional.of("target,foo"));
|
||||
when(flowReporter.eppInput.getTargetIds()).thenReturn(ImmutableList.of("target,foo"));
|
||||
flowReporter.recordToLogs();
|
||||
|
|
|
@ -19,7 +19,7 @@ import static google.registry.testing.ContactResourceSubject.assertAboutContacts
|
|||
import static google.registry.testing.DatastoreHelper.assertNoBillingEvents;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.newContactResource;
|
||||
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.persistDeletedContact;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -166,7 +166,7 @@ public class ContactDeleteFlowTest
|
|||
public void testFailure_failfastWhenLinkedToDomain() throws Exception {
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld", persistActiveContact(getUniqueIdFromCommand())));
|
||||
newDomainBase("example.tld", persistActiveContact(getUniqueIdFromCommand())));
|
||||
EppException thrown = assertThrows(ResourceToDeleteIsReferencedException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ public class ContactDeleteFlowTest
|
|||
public void testFailure_failfastWhenLinkedToApplication() throws Exception {
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld", persistActiveContact(getUniqueIdFromCommand())));
|
||||
newDomainBase("example.tld", persistActiveContact(getUniqueIdFromCommand())));
|
||||
EppException thrown = assertThrows(ResourceToDeleteIsReferencedException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
import static google.registry.model.EppResourceUtils.isDeleted;
|
||||
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.persistResource;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -110,7 +110,7 @@ public class ContactInfoFlowTest extends ResourceFlowTestCase<ContactInfoFlow, C
|
|||
@Test
|
||||
public void testSuccess_linked() throws Exception {
|
||||
createTld("foobar");
|
||||
persistResource(newDomainResource("example.foobar", persistContactResource(true)));
|
||||
persistResource(newDomainBase("example.foobar", persistContactResource(true)));
|
||||
// Check that the persisted contact info was returned.
|
||||
assertTransactionalFlow(false);
|
||||
runFlowAssertResponse(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -19,7 +19,7 @@ import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
|||
import static google.registry.testing.DatastoreHelper.assertNoBillingEvents;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
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.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedHost;
|
||||
|
@ -48,7 +48,7 @@ import google.registry.flows.host.HostFlowUtils.HostNameTooShallowException;
|
|||
import google.registry.flows.host.HostFlowUtils.InvalidHostNameException;
|
||||
import google.registry.flows.host.HostFlowUtils.SuperordinateDomainDoesNotExistException;
|
||||
import google.registry.flows.host.HostFlowUtils.SuperordinateDomainInPendingDeleteException;
|
||||
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.reporting.HistoryEntry;
|
||||
|
@ -115,8 +115,8 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
public void testSuccess_internalNeverExisted() throws Exception {
|
||||
doSuccessfulInternalTest("tld");
|
||||
HostResource host = reloadResourceByForeignKey();
|
||||
DomainResource superordinateDomain =
|
||||
loadByForeignKey(DomainResource.class, "example.tld", clock.nowUtc()).get();
|
||||
DomainBase superordinateDomain =
|
||||
loadByForeignKey(DomainBase.class, "example.tld", clock.nowUtc()).get();
|
||||
assertAboutHosts().that(host).hasSuperordinateDomain(Key.create(superordinateDomain));
|
||||
assertThat(superordinateDomain.getSubordinateHosts()).containsExactly("ns1.example.tld");
|
||||
assertDnsTasksEnqueued("ns1.example.tld");
|
||||
|
@ -144,8 +144,8 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
persistDeletedHost(getUniqueIdFromCommand(), clock.nowUtc().minusDays(1));
|
||||
doSuccessfulInternalTest("tld");
|
||||
HostResource host = reloadResourceByForeignKey();
|
||||
DomainResource superordinateDomain =
|
||||
loadByForeignKey(DomainResource.class, "example.tld", clock.nowUtc()).get();
|
||||
DomainBase superordinateDomain =
|
||||
loadByForeignKey(DomainBase.class, "example.tld", clock.nowUtc()).get();
|
||||
assertAboutHosts().that(host).hasSuperordinateDomain(Key.create(superordinateDomain));
|
||||
assertThat(superordinateDomain.getSubordinateHosts()).containsExactly("ns1.example.tld");
|
||||
assertDnsTasksEnqueued("ns1.example.tld");
|
||||
|
@ -183,7 +183,7 @@ public class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, Hos
|
|||
setEppHostCreateInputWithIps("ns1.example.tld");
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setDeletionTime(clock.nowUtc().plusDays(35))
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE))
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.flows.host;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
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.newHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedHost;
|
||||
|
@ -39,7 +39,7 @@ import google.registry.flows.exceptions.ResourceToDeleteIsReferencedException;
|
|||
import google.registry.flows.host.HostFlowUtils.HostNameNotLowerCaseException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameNotNormalizedException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameNotPunyCodedException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -176,9 +176,9 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
public void testSuccess_authorizedClientReadFromSuperordinate() throws Exception {
|
||||
sessionMetadata.setClientId("TheRegistrar");
|
||||
createTld("tld");
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("TheRegistrar")
|
||||
.build());
|
||||
|
@ -196,9 +196,9 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
public void testFailure_unauthorizedClientReadFromSuperordinate() {
|
||||
sessionMetadata.setClientId("TheRegistrar");
|
||||
createTld("tld");
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("NewRegistrar")
|
||||
.build());
|
||||
|
@ -220,9 +220,9 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
DateTime now = clock.nowUtc();
|
||||
DateTime requestTime = now.minusDays(1).minus(Registry.DEFAULT_AUTOMATIC_TRANSFER_LENGTH);
|
||||
DateTime transferExpirationTime = now.minusDays(1);
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("NewRegistrar") // Shouldn't hurt.
|
||||
.addStatusValue(StatusValue.PENDING_TRANSFER)
|
||||
|
@ -253,9 +253,9 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
DateTime now = clock.nowUtc();
|
||||
DateTime requestTime = now.minusDays(1).minus(Registry.DEFAULT_AUTOMATIC_TRANSFER_LENGTH);
|
||||
DateTime transferExpirationTime = now.minusDays(1);
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("NewRegistrar") // Shouldn't help.
|
||||
.addStatusValue(StatusValue.PENDING_TRANSFER)
|
||||
|
@ -282,7 +282,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
public void testFailure_failfastWhenLinkedToDomain() {
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(persistActiveHost("ns1.example.tld"))))
|
||||
.build());
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.flows.host;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
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.persistResource;
|
||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -32,7 +32,7 @@ import google.registry.flows.ResourceFlowUtils.ResourceDoesNotExistException;
|
|||
import google.registry.flows.host.HostFlowUtils.HostNameNotLowerCaseException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameNotNormalizedException;
|
||||
import google.registry.flows.host.HostFlowUtils.HostNameNotPunyCodedException;
|
||||
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 javax.annotation.Nullable;
|
||||
|
@ -90,7 +90,7 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
|
|||
public void testSuccess_linked() throws Exception {
|
||||
persistHostResource();
|
||||
persistResource(
|
||||
newDomainResource("example.foobar")
|
||||
newDomainBase("example.foobar")
|
||||
.asBuilder()
|
||||
.addNameserver(Key.create(persistHostResource()))
|
||||
.build());
|
||||
|
@ -106,9 +106,9 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
|
|||
|
||||
private void runTest_superordinateDomain(
|
||||
DateTime domainTransferTime, @Nullable DateTime lastSuperordinateChange) throws Exception {
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("parent.foobar")
|
||||
newDomainBase("parent.foobar")
|
||||
.asBuilder()
|
||||
.setRepoId("BEEF-FOOBAR")
|
||||
.setLastTransferTime(domainTransferTime)
|
||||
|
|
|
@ -22,14 +22,14 @@ 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.getOnlyHistoryEntryOfType;
|
||||
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.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveSubordinateHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedHost;
|
||||
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.GenericEppResourceSubject.assertAboutEppResources;
|
||||
import static google.registry.testing.HistoryEntrySubject.assertAboutHistoryEntries;
|
||||
|
@ -68,7 +68,7 @@ import google.registry.flows.host.HostUpdateFlow.CannotRemoveSubordinateHostLast
|
|||
import google.registry.flows.host.HostUpdateFlow.CannotRenameExternalHostException;
|
||||
import google.registry.flows.host.HostUpdateFlow.HostAlreadyExistsException;
|
||||
import google.registry.flows.host.HostUpdateFlow.RenameHostToExternalRemoveIpException;
|
||||
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.index.ForeignKeyIndex;
|
||||
|
@ -108,11 +108,11 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
*
|
||||
* <p>The transfer is from "TheRegistrar" to "NewRegistrar".
|
||||
*/
|
||||
private DomainResource createDomainWithServerApprovedTransfer(String domainName) {
|
||||
private DomainBase createDomainWithServerApprovedTransfer(String domainName) {
|
||||
DateTime now = clock.nowUtc();
|
||||
DateTime requestTime = now.minusDays(1).minus(Registry.DEFAULT_AUTOMATIC_TRANSFER_LENGTH);
|
||||
DateTime transferExpirationTime = now.minusDays(1);
|
||||
return newDomainResource(domainName)
|
||||
return newDomainBase(domainName)
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("TheRegistrar")
|
||||
.addStatusValue(StatusValue.PENDING_TRANSFER)
|
||||
|
@ -192,7 +192,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
HostResource host =
|
||||
persistActiveSubordinateHost(oldHostName(), persistActiveDomain("example.tld"));
|
||||
persistResource(
|
||||
newDomainResource("test.xn--q9jyb4c")
|
||||
newDomainBase("test.xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setDeletionTime(END_OF_TIME)
|
||||
.setNameservers(ImmutableSet.of(Key.create(host)))
|
||||
|
@ -211,7 +211,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
public void testSuccess_nameUnchanged_superordinateDomainNeverTransferred() throws Exception {
|
||||
setEppInput("host_update_name_unchanged.xml");
|
||||
createTld("tld");
|
||||
DomainResource domain = persistActiveDomain("example.tld");
|
||||
DomainBase domain = persistActiveDomain("example.tld");
|
||||
HostResource oldHost = persistActiveSubordinateHost(oldHostName(), domain);
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||
|
@ -237,7 +237,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
setEppInput("host_update_name_unchanged.xml");
|
||||
createTld("tld");
|
||||
// Create a domain that will belong to NewRegistrar after cloneProjectedAtTime is called.
|
||||
DomainResource domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
DomainBase domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
HostResource oldHost = persistActiveSubordinateHost(oldHostName(), domain);
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(loadFile("generic_success_response.xml"));
|
||||
|
@ -267,9 +267,9 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
createTld("tld");
|
||||
DateTime now = clock.nowUtc();
|
||||
DateTime oneDayAgo = now.minusDays(1);
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of(oldHostName()))
|
||||
.setLastTransferTime(oneDayAgo)
|
||||
|
@ -286,7 +286,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
.hasPersistedCurrentSponsorClientId("TheRegistrar")
|
||||
.and()
|
||||
.hasLastTransferTime(oneDayAgo);
|
||||
DomainResource reloadedDomain = ofy().load().entity(domain).now().cloneProjectedAtTime(now);
|
||||
DomainBase reloadedDomain = ofy().load().entity(domain).now().cloneProjectedAtTime(now);
|
||||
assertThat(reloadedDomain.getSubordinateHosts()).containsExactly("ns2.example.tld");
|
||||
assertDnsTasksEnqueued("ns1.example.tld", "ns2.example.tld");
|
||||
}
|
||||
|
@ -299,10 +299,10 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"<host:addr ip=\"v4\">192.0.2.22</host:addr>",
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("tld");
|
||||
DomainResource example = persistActiveDomain("example.tld");
|
||||
DomainResource foo =
|
||||
DomainBase example = persistActiveDomain("example.tld");
|
||||
DomainBase foo =
|
||||
persistResource(
|
||||
newDomainResource("foo.tld")
|
||||
newDomainBase("foo.tld")
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of(oldHostName()))
|
||||
.build());
|
||||
|
@ -336,13 +336,13 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("foo");
|
||||
createTld("tld");
|
||||
DomainResource fooDomain =
|
||||
DomainBase fooDomain =
|
||||
persistResource(
|
||||
newDomainResource("example.foo")
|
||||
newDomainBase("example.foo")
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of(oldHostName()))
|
||||
.build());
|
||||
DomainResource tldDomain = persistActiveDomain("example.tld");
|
||||
DomainBase tldDomain = persistActiveDomain("example.tld");
|
||||
persistActiveSubordinateHost(oldHostName(), fooDomain);
|
||||
assertThat(fooDomain.getSubordinateHosts()).containsExactly("ns1.example.foo");
|
||||
assertThat(tldDomain.getSubordinateHosts()).isEmpty();
|
||||
|
@ -357,10 +357,10 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
.hasPersistedCurrentSponsorClientId("TheRegistrar")
|
||||
.and()
|
||||
.hasLastTransferTime(null);
|
||||
DomainResource reloadedFooDomain =
|
||||
DomainBase reloadedFooDomain =
|
||||
ofy().load().entity(fooDomain).now().cloneProjectedAtTime(now);
|
||||
assertThat(reloadedFooDomain.getSubordinateHosts()).isEmpty();
|
||||
DomainResource reloadedTldDomain =
|
||||
DomainBase reloadedTldDomain =
|
||||
ofy().load().entity(tldDomain).now().cloneProjectedAtTime(now);
|
||||
assertThat(reloadedTldDomain.getSubordinateHosts()).containsExactly("ns2.example.tld");
|
||||
assertDnsTasksEnqueued("ns1.example.foo", "ns2.example.tld");
|
||||
|
@ -374,9 +374,9 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
null,
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("foo");
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.foo")
|
||||
newDomainBase("example.foo")
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of(oldHostName()))
|
||||
.build());
|
||||
|
@ -402,7 +402,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
.and()
|
||||
.hasLastSuperordinateChange(clock.nowUtc());
|
||||
assertThat(renamedHost.getLastTransferTime()).isEqualTo(oneDayAgo);
|
||||
DomainResource reloadedDomain =
|
||||
DomainBase reloadedDomain =
|
||||
ofy().load().entity(domain).now().cloneProjectedAtTime(clock.nowUtc());
|
||||
assertThat(reloadedDomain.getSubordinateHosts()).isEmpty();
|
||||
assertDnsTasksEnqueued("ns1.example.foo");
|
||||
|
@ -413,7 +413,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
setEppHostUpdateInput(
|
||||
"ns1.example.foo", "ns2.example.tld", "<host:addr ip=\"v4\">192.0.2.22</host:addr>", null);
|
||||
createTld("tld");
|
||||
DomainResource domain = persistActiveDomain("example.tld");
|
||||
DomainBase domain = persistActiveDomain("example.tld");
|
||||
persistActiveHost(oldHostName());
|
||||
assertThat(domain.getSubordinateHosts()).isEmpty();
|
||||
assertThrows(CannotRenameExternalHostException.class, this::runFlow);
|
||||
|
@ -425,7 +425,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
setEppHostUpdateInput(
|
||||
"ns1.example.foo", "ns2.example.tld", "<host:addr ip=\"v4\">192.0.2.22</host:addr>", null);
|
||||
createTld("tld");
|
||||
DomainResource domain = persistActiveDomain("example.tld");
|
||||
DomainBase domain = persistActiveDomain("example.tld");
|
||||
persistActiveHost(oldHostName());
|
||||
assertThat(domain.getSubordinateHosts()).isEmpty();
|
||||
HostResource renamedHost = doSuccessfulTestAsSuperuser();
|
||||
|
@ -501,12 +501,12 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("tld");
|
||||
DateTime lastTransferTime = clock.nowUtc().minusDays(5);
|
||||
DomainResource foo =
|
||||
newDomainResource("foo.tld").asBuilder().setLastTransferTime(lastTransferTime).build();
|
||||
DomainBase foo =
|
||||
newDomainBase("foo.tld").asBuilder().setLastTransferTime(lastTransferTime).build();
|
||||
// Set the new domain to have a last transfer time that is different than the last transfer
|
||||
// time on the host in question.
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setLastTransferTime(clock.nowUtc().minusDays(10))
|
||||
.build());
|
||||
|
@ -535,15 +535,15 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"<host:addr ip=\"v4\">192.0.2.22</host:addr>",
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("tld");
|
||||
DomainResource domain =
|
||||
newDomainResource("foo.tld")
|
||||
DomainBase domain =
|
||||
newDomainBase("foo.tld")
|
||||
.asBuilder()
|
||||
.setLastTransferTime(clock.nowUtc().minusDays(5))
|
||||
.build();
|
||||
// Set the new domain to have a last transfer time that is different than the last transfer
|
||||
// time on the host in question.
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setLastTransferTime(clock.nowUtc().minusDays(10))
|
||||
.build());
|
||||
|
@ -574,13 +574,13 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"<host:addr ip=\"v4\">192.0.2.22</host:addr>",
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("tld");
|
||||
DomainResource foo =
|
||||
newDomainResource("foo.tld")
|
||||
DomainBase foo =
|
||||
newDomainBase("foo.tld")
|
||||
.asBuilder()
|
||||
.setLastTransferTime(clock.nowUtc().minusDays(5))
|
||||
.build();
|
||||
// Set the new domain to have a null last transfer time.
|
||||
persistResource(newDomainResource("example.tld").asBuilder().setLastTransferTime(null).build());
|
||||
persistResource(newDomainBase("example.tld").asBuilder().setLastTransferTime(null).build());
|
||||
DateTime lastTransferTime = clock.nowUtc().minusDays(20);
|
||||
|
||||
persistResource(
|
||||
|
@ -609,9 +609,9 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"<host:addr ip=\"v4\">192.0.2.22</host:addr>",
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("tld");
|
||||
DomainResource foo = newDomainResource("foo.tld").asBuilder().setLastTransferTime(null).build();
|
||||
DomainBase foo = newDomainBase("foo.tld").asBuilder().setLastTransferTime(null).build();
|
||||
// Set the new domain to have a null last transfer time.
|
||||
persistResource(newDomainResource("example.tld").asBuilder().setLastTransferTime(null).build());
|
||||
persistResource(newDomainBase("example.tld").asBuilder().setLastTransferTime(null).build());
|
||||
DateTime lastTransferTime = clock.nowUtc().minusDays(20);
|
||||
|
||||
persistResource(
|
||||
|
@ -639,13 +639,13 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"<host:addr ip=\"v4\">192.0.2.22</host:addr>",
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("tld");
|
||||
DomainResource foo =
|
||||
newDomainResource("foo.tld")
|
||||
DomainBase foo =
|
||||
newDomainBase("foo.tld")
|
||||
.asBuilder()
|
||||
.setLastTransferTime(clock.nowUtc().minusDays(5))
|
||||
.build();
|
||||
// Set the new domain to have a null last transfer time.
|
||||
persistResource(newDomainResource("example.tld").asBuilder().setLastTransferTime(null).build());
|
||||
persistResource(newDomainBase("example.tld").asBuilder().setLastTransferTime(null).build());
|
||||
persistResource(
|
||||
newHostResource(oldHostName())
|
||||
.asBuilder()
|
||||
|
@ -671,7 +671,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
null,
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("foo");
|
||||
DomainResource domain = persistActiveDomain("example.foo");
|
||||
DomainBase domain = persistActiveDomain("example.foo");
|
||||
persistResource(
|
||||
newHostResource(oldHostName())
|
||||
.asBuilder()
|
||||
|
@ -707,7 +707,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
null,
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("foo");
|
||||
DomainResource domain = persistActiveDomain("example.foo");
|
||||
DomainBase domain = persistActiveDomain("example.foo");
|
||||
DateTime lastTransferTime = clock.nowUtc().minusDays(12);
|
||||
persistResource(
|
||||
newHostResource(oldHostName())
|
||||
|
@ -743,7 +743,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
null,
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("foo");
|
||||
DomainResource domain = persistActiveDomain("example.foo");
|
||||
DomainBase domain = persistActiveDomain("example.foo");
|
||||
persistResource(
|
||||
newHostResource(oldHostName())
|
||||
.asBuilder()
|
||||
|
@ -774,7 +774,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"ns1.example.foo", "ns2.example.tld", "<host:addr ip=\"v4\">192.0.2.22</host:addr>", null);
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setLastTransferTime(domainTransferTime)
|
||||
.build());
|
||||
|
@ -826,9 +826,9 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
"<host:addr ip=\"v4\">192.0.2.22</host:addr>",
|
||||
"<host:addr ip=\"v6\">1080:0:0:0:8:800:200C:417A</host:addr>");
|
||||
createTld("tld");
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of(oldHostName()))
|
||||
.setDeletionTime(clock.nowUtc().plusDays(35))
|
||||
|
@ -1095,9 +1095,9 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
public void testSuccess_authorizedClientReadFromSuperordinate() throws Exception {
|
||||
sessionMetadata.setClientId("NewRegistrar");
|
||||
createTld("tld");
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("NewRegistrar")
|
||||
.build());
|
||||
|
@ -1117,9 +1117,9 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
public void testFailure_unauthorizedClientReadFromSuperordinate() {
|
||||
sessionMetadata.setClientId("NewRegistrar");
|
||||
createTld("tld");
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("TheRegistrar")
|
||||
.build());
|
||||
|
@ -1140,7 +1140,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
sessionMetadata.setClientId("NewRegistrar");
|
||||
createTld("tld");
|
||||
// Create a domain that will belong to NewRegistrar after cloneProjectedAtTime is called.
|
||||
DomainResource domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
DomainBase domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
persistResource(
|
||||
newHostResource("ns1.example.tld")
|
||||
.asBuilder()
|
||||
|
@ -1158,7 +1158,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
sessionMetadata.setClientId("TheRegistrar");
|
||||
createTld("tld");
|
||||
// Create a domain that will belong to NewRegistrar after cloneProjectedAtTime is called.
|
||||
DomainResource domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
DomainBase domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
persistResource(
|
||||
newHostResource("ns1.example.tld")
|
||||
.asBuilder()
|
||||
|
@ -1179,7 +1179,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
createTld("foo");
|
||||
createTld("tld");
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("NewRegistar")
|
||||
.build());
|
||||
|
@ -1201,7 +1201,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
HostResource host =
|
||||
persistActiveSubordinateHost(oldHostName(), persistActiveDomain("example.foo"));
|
||||
// The domain will belong to NewRegistrar after cloneProjectedAtTime is called.
|
||||
DomainResource domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
DomainBase domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
assertAboutDomains().that(domain).hasPersistedCurrentSponsorClientId("TheRegistrar");
|
||||
assertAboutHosts().that(host).hasPersistedCurrentSponsorClientId("TheRegistrar");
|
||||
|
||||
|
@ -1217,10 +1217,10 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
createTld("foo");
|
||||
createTld("tld");
|
||||
// The domain will belong to NewRegistrar after cloneProjectedAtTime is called.
|
||||
DomainResource domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
DomainResource superordinate =
|
||||
DomainBase domain = persistResource(createDomainWithServerApprovedTransfer("example.tld"));
|
||||
DomainBase superordinate =
|
||||
persistResource(
|
||||
newDomainResource("example.foo")
|
||||
newDomainBase("example.foo")
|
||||
.asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("NewRegistrar")
|
||||
.build());
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.flows.poll;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createHistoryEntryForEppResource;
|
||||
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.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -30,7 +30,7 @@ import google.registry.flows.poll.PollAckFlow.MessageDoesNotExistException;
|
|||
import google.registry.flows.poll.PollAckFlow.MissingMessageIdException;
|
||||
import google.registry.flows.poll.PollAckFlow.NotAuthorizedToAckMessageException;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
|
@ -42,7 +42,7 @@ public class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
|||
/** This is the message id being sent in the ACK request. */
|
||||
private static final long MESSAGE_ID = 3;
|
||||
|
||||
private DomainResource domain;
|
||||
private DomainBase domain;
|
||||
private ContactResource contact;
|
||||
|
||||
@Before
|
||||
|
@ -54,7 +54,7 @@ public class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
|||
clock.advanceOneMilli();
|
||||
contact = persistActiveContact("jd1234");
|
||||
clock.advanceOneMilli();
|
||||
domain = persistResource(newDomainResource("test.example", contact));
|
||||
domain = persistResource(newDomainBase("test.example", contact));
|
||||
clock.advanceOneMilli();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ package google.registry.flows.poll;
|
|||
|
||||
import static google.registry.testing.DatastoreHelper.createHistoryEntryForEppResource;
|
||||
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;
|
||||
|
@ -28,7 +28,7 @@ import google.registry.flows.EppException;
|
|||
import google.registry.flows.FlowTestCase;
|
||||
import google.registry.flows.poll.PollRequestFlow.UnexpectedMessageIdException;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.poll.PendingActionNotificationResponse.DomainPendingActionNotificationResponse;
|
||||
|
@ -44,7 +44,7 @@ import org.junit.Test;
|
|||
/** Unit tests for {@link PollRequestFlow}. */
|
||||
public class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||
|
||||
private DomainResource domain;
|
||||
private DomainBase domain;
|
||||
private ContactResource contact;
|
||||
private HostResource host;
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
|||
clock.setTo(DateTime.parse("2011-01-02T01:01:01Z"));
|
||||
createTld("example");
|
||||
contact = persistActiveContact("jd1234");
|
||||
domain = persistResource(newDomainResource("test.example", contact));
|
||||
domain = persistResource(newDomainBase("test.example", contact));
|
||||
host = persistActiveHost("ns1.test.example");
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import static google.registry.mapreduce.inputs.EppResourceInputs.createChildEnti
|
|||
import static google.registry.model.index.EppResourceIndexBucket.getBucketKey;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.newContactResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainBase;
|
||||
import static google.registry.testing.DatastoreHelper.persistEppResourceInFirstBucket;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistSimpleResource;
|
||||
|
@ -36,7 +36,7 @@ import google.registry.model.ImmutableObject;
|
|||
import google.registry.model.billing.BillingEvent;
|
||||
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.index.EppResourceIndex;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
|
@ -63,8 +63,8 @@ public class ChildEntityInputTest {
|
|||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
DomainResource domainA;
|
||||
DomainResource domainB;
|
||||
DomainBase domainA;
|
||||
DomainBase domainB;
|
||||
HistoryEntry domainHistoryEntryA;
|
||||
HistoryEntry domainHistoryEntryB;
|
||||
HistoryEntry contactHistoryEntry;
|
||||
|
@ -76,7 +76,7 @@ public class ChildEntityInputTest {
|
|||
private void setupResources() {
|
||||
createTld("tld");
|
||||
ContactResource contact = persistEppResourceInFirstBucket(newContactResource("contact1234"));
|
||||
domainA = persistEppResourceInFirstBucket(newDomainResource("a.tld", contact));
|
||||
domainA = persistEppResourceInFirstBucket(newDomainBase("a.tld", contact));
|
||||
domainHistoryEntryA = persistResource(
|
||||
new HistoryEntry.Builder()
|
||||
.setParent(domainA)
|
||||
|
@ -110,8 +110,8 @@ public class ChildEntityInputTest {
|
|||
.build());
|
||||
}
|
||||
|
||||
private void setupSecondDomainResources() {
|
||||
domainB = persistEppResourceInFirstBucket(newDomainResource("b.tld"));
|
||||
private void setupSecondDomainBases() {
|
||||
domainB = persistEppResourceInFirstBucket(newDomainBase("b.tld"));
|
||||
domainHistoryEntryB = persistResource(
|
||||
new HistoryEntry.Builder()
|
||||
.setParent(domainB)
|
||||
|
@ -155,7 +155,7 @@ public class ChildEntityInputTest {
|
|||
@Test
|
||||
public void testSuccess_childEntityReader_multipleParentsAndChildren() throws Exception {
|
||||
setupResources();
|
||||
setupSecondDomainResources();
|
||||
setupSecondDomainBases();
|
||||
Set<ImmutableObject> seen = new HashSet<>();
|
||||
InputReader<ImmutableObject> reader = EppResourceInputs.createChildEntityInput(
|
||||
ImmutableSet.of(EppResource.class),
|
||||
|
@ -262,7 +262,7 @@ public class ChildEntityInputTest {
|
|||
@Test
|
||||
public void testSuccess_childEntityReader_readerCountMatchesBucketCount() throws Exception {
|
||||
assertThat(EppResourceInputs.createChildEntityInput(
|
||||
ImmutableSet.<Class<? extends EppResource>>of(DomainResource.class),
|
||||
ImmutableSet.<Class<? extends EppResource>>of(DomainBase.class),
|
||||
ImmutableSet.<Class<? extends ImmutableObject>>of(
|
||||
BillingEvent.OneTime.class)).createReaders()).hasSize(3);
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ public class ChildEntityInputTest {
|
|||
createTld("tld");
|
||||
Set<ImmutableObject> historyEntries = new HashSet<>();
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
DomainResource domain = persistSimpleResource(newDomainResource(i + ".tld"));
|
||||
DomainBase domain = persistSimpleResource(newDomainBase(i + ".tld"));
|
||||
historyEntries.add(persistResource(
|
||||
new HistoryEntry.Builder()
|
||||
.setParent(domain)
|
||||
|
@ -283,7 +283,7 @@ public class ChildEntityInputTest {
|
|||
}
|
||||
Set<ImmutableObject> seen = new HashSet<>();
|
||||
for (InputReader<ImmutableObject> reader : EppResourceInputs.createChildEntityInput(
|
||||
ImmutableSet.<Class<? extends EppResource>>of(DomainResource.class),
|
||||
ImmutableSet.<Class<? extends EppResource>>of(DomainBase.class),
|
||||
ImmutableSet.<Class<? extends ImmutableObject>>of(HistoryEntry.class)).createReaders()) {
|
||||
reader.beginShard();
|
||||
reader.beginSlice();
|
||||
|
|
|
@ -21,7 +21,7 @@ import static google.registry.mapreduce.inputs.EppResourceInputs.createKeyInput;
|
|||
import static google.registry.model.index.EppResourceIndexBucket.getBucketKey;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.newContactResource;
|
||||
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.persistEppResourceInFirstBucket;
|
||||
|
@ -34,7 +34,6 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.EppResourceIndex;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
|
@ -72,14 +71,7 @@ public class EppResourceInputsTest {
|
|||
|
||||
@Test
|
||||
public void testSuccess_keyInputType_polymorphicBaseType() {
|
||||
createKeyInput(DomainBase.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_keyInputType_polymorphicSubclass() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(IllegalArgumentException.class, () -> createKeyInput(DomainResource.class));
|
||||
assertThat(thrown).hasMessageThat().contains("non-polymorphic");
|
||||
createKeyInput(EppResource.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -91,19 +83,12 @@ public class EppResourceInputsTest {
|
|||
assertThat(thrown).hasMessageThat().contains("inheritance");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_entityInputTypesMayBePolymorphic() {
|
||||
// Both polymorphic and not should work.
|
||||
createEntityInput(DomainBase.class);
|
||||
createEntityInput(DomainResource.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_entityInputType_noInheritanceBetweenTypes_eppResource() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> createEntityInput(EppResource.class, DomainResource.class));
|
||||
() -> createEntityInput(EppResource.class, DomainBase.class));
|
||||
assertThat(thrown).hasMessageThat().contains("inheritance");
|
||||
}
|
||||
|
||||
|
@ -112,7 +97,7 @@ public class EppResourceInputsTest {
|
|||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> createEntityInput(DomainBase.class, DomainResource.class));
|
||||
() -> createEntityInput(EppResource.class, ContactResource.class));
|
||||
assertThat(thrown).hasMessageThat().contains("inheritance");
|
||||
}
|
||||
|
||||
|
@ -125,9 +110,9 @@ public class EppResourceInputsTest {
|
|||
@Test
|
||||
public void testKeyInput_oneReaderPerBucket() throws Exception {
|
||||
createTld("tld");
|
||||
Set<Key<DomainResource>> domains = new HashSet<>();
|
||||
Set<Key<DomainBase>> domains = new HashSet<>();
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
Key<DomainResource> key = Key.create(newDomainResource(i + ".tld"));
|
||||
Key<DomainBase> key = Key.create(newDomainBase(i + ".tld"));
|
||||
domains.add(key);
|
||||
persistResource(EppResourceIndex.create(getBucketKey(i), key));
|
||||
}
|
||||
|
@ -148,21 +133,21 @@ public class EppResourceInputsTest {
|
|||
@Test
|
||||
public void testEntityInput_oneReaderPerBucket() throws Exception {
|
||||
createTld("tld");
|
||||
Set<DomainResource> domains = new HashSet<>();
|
||||
Set<DomainBase> domains = new HashSet<>();
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
// Persist the domain as a simple resource so that it doesn't automatically get an ERI.
|
||||
DomainResource domain = persistSimpleResource(newDomainResource(i + ".tld"));
|
||||
DomainBase domain = persistSimpleResource(newDomainBase(i + ".tld"));
|
||||
domains.add(domain);
|
||||
persistResource(EppResourceIndex.create(getBucketKey(i), Key.create(domain)));
|
||||
}
|
||||
Set<DomainResource> seen = new HashSet<>();
|
||||
for (InputReader<DomainResource> reader
|
||||
: createEntityInput(DomainResource.class).createReaders()) {
|
||||
Set<DomainBase> seen = new HashSet<>();
|
||||
for (InputReader<DomainBase> reader
|
||||
: createEntityInput(DomainBase.class).createReaders()) {
|
||||
reader.beginShard();
|
||||
reader.beginSlice();
|
||||
seen.add(reader.next());
|
||||
try {
|
||||
DomainResource domain = reader.next();
|
||||
DomainBase domain = reader.next();
|
||||
assert_().fail("Unexpected element: " + domain);
|
||||
} catch (NoSuchElementException expected) {
|
||||
}
|
||||
|
@ -173,8 +158,8 @@ public class EppResourceInputsTest {
|
|||
@Test
|
||||
public void testSuccess_keyReader_survivesAcrossSerialization() throws Exception {
|
||||
createTld("tld");
|
||||
DomainResource domainA = persistEppResourceInFirstBucket(newDomainResource("a.tld"));
|
||||
DomainResource domainB = persistEppResourceInFirstBucket(newDomainResource("b.tld"));
|
||||
DomainBase domainA = persistEppResourceInFirstBucket(newDomainBase("a.tld"));
|
||||
DomainBase domainB = persistEppResourceInFirstBucket(newDomainBase("b.tld"));
|
||||
// Should be ignored. We'll know if it isn't because the progress counts will be off.
|
||||
persistActiveContact("contact");
|
||||
Set<Key<DomainBase>> seen = new HashSet<>();
|
||||
|
@ -197,20 +182,20 @@ public class EppResourceInputsTest {
|
|||
@Test
|
||||
public void testSuccess_entityReader_survivesAcrossSerialization() throws Exception {
|
||||
createTld("tld");
|
||||
DomainResource domainA = persistEppResourceInFirstBucket(newDomainResource("a.tld"));
|
||||
DomainResource domainB = persistEppResourceInFirstBucket(newDomainResource("b.tld"));
|
||||
DomainBase domainA = persistEppResourceInFirstBucket(newDomainBase("a.tld"));
|
||||
DomainBase domainB = persistEppResourceInFirstBucket(newDomainBase("b.tld"));
|
||||
// Should be ignored. We'll know if it isn't because the progress counts will be off.
|
||||
persistActiveContact("contact");
|
||||
Set<DomainResource> seen = new HashSet<>();
|
||||
InputReader<DomainResource> reader =
|
||||
createEntityInput(DomainResource.class).createReaders().get(0);
|
||||
Set<DomainBase> seen = new HashSet<>();
|
||||
InputReader<DomainBase> reader =
|
||||
createEntityInput(DomainBase.class).createReaders().get(0);
|
||||
reader.beginShard();
|
||||
reader.beginSlice();
|
||||
assertThat(reader.getProgress()).isWithin(EPSILON).of(0);
|
||||
seen.add(reader.next());
|
||||
assertThat(reader.getProgress()).isWithin(EPSILON).of(0.5);
|
||||
reader.endSlice();
|
||||
InputReader<DomainResource> deserializedReader = serializeAndDeserialize(reader);
|
||||
InputReader<DomainBase> deserializedReader = serializeAndDeserialize(reader);
|
||||
deserializedReader.beginSlice();
|
||||
assertThat(deserializedReader.getProgress()).isWithin(EPSILON).of(0.5);
|
||||
seen.add(deserializedReader.next());
|
||||
|
@ -224,13 +209,13 @@ public class EppResourceInputsTest {
|
|||
@Test
|
||||
public void testSuccess_entityReader_filtersOnMultipleTypes() throws Exception {
|
||||
createTld("tld");
|
||||
DomainResource domain = persistEppResourceInFirstBucket(newDomainResource("a.tld"));
|
||||
DomainBase domain = persistEppResourceInFirstBucket(newDomainBase("a.tld"));
|
||||
HostResource host = persistEppResourceInFirstBucket(newHostResource("ns1.example.com"));
|
||||
persistEppResourceInFirstBucket(newContactResource("contact"));
|
||||
Set<EppResource> seen = new HashSet<>();
|
||||
InputReader<EppResource> reader =
|
||||
EppResourceInputs.<EppResource>createEntityInput(
|
||||
DomainResource.class, HostResource.class).createReaders().get(0);
|
||||
DomainBase.class, HostResource.class).createReaders().get(0);
|
||||
reader.beginShard();
|
||||
reader.beginSlice();
|
||||
assertThat(reader.getProgress()).isWithin(EPSILON).of(0);
|
||||
|
@ -247,8 +232,8 @@ public class EppResourceInputsTest {
|
|||
createTld("tld");
|
||||
ContactResource contact = persistEppResourceInFirstBucket(newContactResource("contact"));
|
||||
// Specify the contact since persistActiveDomain{Application} creates a hidden one.
|
||||
DomainResource domain1 = persistEppResourceInFirstBucket(newDomainResource("a.tld", contact));
|
||||
DomainResource domain2 = persistEppResourceInFirstBucket(newDomainResource("b.tld", contact));
|
||||
DomainBase domain1 = persistEppResourceInFirstBucket(newDomainBase("a.tld", contact));
|
||||
DomainBase domain2 = persistEppResourceInFirstBucket(newDomainBase("b.tld", contact));
|
||||
HostResource host = persistEppResourceInFirstBucket(newHostResource("ns1.example.com"));
|
||||
Set<EppResource> seen = new HashSet<>();
|
||||
InputReader<EppResource> reader = createEntityInput(EppResource.class).createReaders().get(0);
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.model.EntityTestCase;
|
||||
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.reporting.HistoryEntry;
|
||||
|
@ -44,7 +44,7 @@ public class BillingEventTest extends EntityTestCase {
|
|||
|
||||
HistoryEntry historyEntry;
|
||||
HistoryEntry historyEntry2;
|
||||
DomainResource domain;
|
||||
DomainBase domain;
|
||||
BillingEvent.OneTime oneTime;
|
||||
BillingEvent.OneTime oneTimeSynthetic;
|
||||
BillingEvent.Recurring recurring;
|
||||
|
|
|
@ -25,7 +25,7 @@ import static google.registry.testing.JUnitBackports.assertThrows;
|
|||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
|
||||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.registry.Registry;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Test;
|
||||
|
@ -70,7 +70,7 @@ public class CursorTest extends EntityTestCase {
|
|||
createTld("tld");
|
||||
clock.advanceOneMilli();
|
||||
final DateTime time = DateTime.parse("2012-07-12T03:30:00.000Z");
|
||||
final DomainResource domain = persistActiveDomain("notaregistry.tld");
|
||||
final DomainBase domain = persistActiveDomain("notaregistry.tld");
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
|
|
|
@ -21,10 +21,10 @@ import static com.google.common.truth.Truth8.assertThat;
|
|||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.testing.DatastoreHelper.cloneAndSetAutoTimestamps;
|
||||
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.newHostResource;
|
||||
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.JUnitBackports.assertThrows;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
import static org.joda.money.CurrencyUnit.USD;
|
||||
|
@ -58,15 +58,15 @@ import org.joda.time.DateTime;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/** Unit tests for {@link DomainResource}. */
|
||||
public class DomainResourceTest extends EntityTestCase {
|
||||
/** Unit tests for {@link DomainBase}. */
|
||||
public class DomainBaseTest extends EntityTestCase {
|
||||
|
||||
DomainResource domain;
|
||||
DomainBase domain;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
createTld("com");
|
||||
Key<DomainResource> domainKey = Key.create(null, DomainResource.class, "4-COM");
|
||||
Key<DomainBase> domainKey = Key.create(null, DomainBase.class, "4-COM");
|
||||
Key<HostResource> hostKey = Key.create(persistResource(
|
||||
new HostResource.Builder()
|
||||
.setFullyQualifiedHostName("ns1.example.com")
|
||||
|
@ -97,7 +97,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
domain =
|
||||
persistResource(
|
||||
cloneAndSetAutoTimestamps(
|
||||
new DomainResource.Builder()
|
||||
new DomainBase.Builder()
|
||||
.setFullyQualifiedDomainName("example.com")
|
||||
.setRepoId("4-COM")
|
||||
.setCreationClientId("a registrar")
|
||||
|
@ -150,7 +150,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
|
||||
@Test
|
||||
public void testPersistence() {
|
||||
assertThat(loadByForeignKey(DomainResource.class, domain.getForeignKey(), clock.nowUtc()))
|
||||
assertThat(loadByForeignKey(DomainBase.class, domain.getForeignKey(), clock.nowUtc()))
|
||||
.hasValue(domain);
|
||||
}
|
||||
|
||||
|
@ -168,17 +168,17 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
|
||||
@Test
|
||||
public void testEmptyStringsBecomeNull() {
|
||||
assertThat(newDomainResource("example.com").asBuilder()
|
||||
assertThat(newDomainBase("example.com").asBuilder()
|
||||
.setPersistedCurrentSponsorClientId(null)
|
||||
.build()
|
||||
.getCurrentSponsorClientId())
|
||||
.isNull();
|
||||
assertThat(newDomainResource("example.com").asBuilder()
|
||||
assertThat(newDomainBase("example.com").asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("")
|
||||
.build()
|
||||
.getCurrentSponsorClientId())
|
||||
.isNull();
|
||||
assertThat(newDomainResource("example.com").asBuilder()
|
||||
assertThat(newDomainBase("example.com").asBuilder()
|
||||
.setPersistedCurrentSponsorClientId(" ")
|
||||
.build()
|
||||
.getCurrentSponsorClientId())
|
||||
|
@ -188,33 +188,33 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
@Test
|
||||
public void testEmptySetsAndArraysBecomeNull() {
|
||||
assertThat(
|
||||
newDomainResource("example.com")
|
||||
newDomainBase("example.com")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of())
|
||||
.build()
|
||||
.nsHosts)
|
||||
.isNull();
|
||||
assertThat(
|
||||
newDomainResource("example.com")
|
||||
newDomainBase("example.com")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of())
|
||||
.build()
|
||||
.nsHosts)
|
||||
.isNull();
|
||||
assertThat(newDomainResource("example.com").asBuilder()
|
||||
assertThat(newDomainBase("example.com").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(newHostResource("foo.example.tld"))))
|
||||
.build().nsHosts)
|
||||
.isNotNull();
|
||||
// This behavior should also hold true for ImmutableObjects nested in collections.
|
||||
assertThat(newDomainResource("example.com").asBuilder()
|
||||
assertThat(newDomainBase("example.com").asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, null)))
|
||||
.build().getDsData().asList().get(0).getDigest())
|
||||
.isNull();
|
||||
assertThat(newDomainResource("example.com").asBuilder()
|
||||
assertThat(newDomainBase("example.com").asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[]{})))
|
||||
.build().getDsData().asList().get(0).getDigest())
|
||||
.isNull();
|
||||
assertThat(newDomainResource("example.com").asBuilder()
|
||||
assertThat(newDomainBase("example.com").asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 1, 1, new byte[]{1})))
|
||||
.build().getDsData().asList().get(0).getDigest())
|
||||
.isNotNull();
|
||||
|
@ -222,9 +222,9 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
|
||||
@Test
|
||||
public void testEmptyTransferDataBecomesNull() {
|
||||
DomainResource withNull =
|
||||
newDomainResource("example.com").asBuilder().setTransferData(null).build();
|
||||
DomainResource withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
|
||||
DomainBase withNull =
|
||||
newDomainBase("example.com").asBuilder().setTransferData(null).build();
|
||||
DomainBase withEmpty = withNull.asBuilder().setTransferData(TransferData.EMPTY).build();
|
||||
assertThat(withNull).isEqualTo(withEmpty);
|
||||
assertThat(withEmpty.transferData).isNull();
|
||||
}
|
||||
|
@ -236,12 +236,12 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
StatusValue[] statuses = {StatusValue.OK};
|
||||
// OK is implicit if there's no other statuses but there are nameservers.
|
||||
assertAboutDomains()
|
||||
.that(newDomainResource("example.com").asBuilder().setNameservers(nameservers).build())
|
||||
.that(newDomainBase("example.com").asBuilder().setNameservers(nameservers).build())
|
||||
.hasExactlyStatusValues(statuses);
|
||||
StatusValue[] statuses1 = {StatusValue.CLIENT_HOLD};
|
||||
// If there are other status values, OK should be suppressed. (Domains can't be LINKED.)
|
||||
assertAboutDomains()
|
||||
.that(newDomainResource("example.com").asBuilder()
|
||||
.that(newDomainBase("example.com").asBuilder()
|
||||
.setNameservers(nameservers)
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_HOLD))
|
||||
.build())
|
||||
|
@ -249,7 +249,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
StatusValue[] statuses2 = {StatusValue.CLIENT_HOLD};
|
||||
// When OK is suppressed, it should be removed even if it was originally there.
|
||||
assertAboutDomains()
|
||||
.that(newDomainResource("example.com").asBuilder()
|
||||
.that(newDomainBase("example.com").asBuilder()
|
||||
.setNameservers(nameservers)
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.OK, StatusValue.CLIENT_HOLD))
|
||||
.build())
|
||||
|
@ -257,19 +257,19 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
StatusValue[] statuses3 = {StatusValue.INACTIVE};
|
||||
// If there are no nameservers, INACTIVE should be added, which suppresses OK.
|
||||
assertAboutDomains()
|
||||
.that(newDomainResource("example.com").asBuilder().build())
|
||||
.that(newDomainBase("example.com").asBuilder().build())
|
||||
.hasExactlyStatusValues(statuses3);
|
||||
StatusValue[] statuses4 = {StatusValue.CLIENT_HOLD, StatusValue.INACTIVE};
|
||||
// If there are no nameservers but there are status values, INACTIVE should still be added.
|
||||
assertAboutDomains()
|
||||
.that(newDomainResource("example.com").asBuilder()
|
||||
.that(newDomainBase("example.com").asBuilder()
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_HOLD))
|
||||
.build())
|
||||
.hasExactlyStatusValues(statuses4);
|
||||
StatusValue[] statuses5 = {StatusValue.CLIENT_HOLD};
|
||||
// If there are nameservers, INACTIVE should be removed even if it was originally there.
|
||||
assertAboutDomains()
|
||||
.that(newDomainResource("example.com").asBuilder()
|
||||
.that(newDomainBase("example.com").asBuilder()
|
||||
.setNameservers(nameservers)
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.INACTIVE, StatusValue.CLIENT_HOLD))
|
||||
.build())
|
||||
|
@ -277,7 +277,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
}
|
||||
|
||||
private void assertTransferred(
|
||||
DomainResource domain,
|
||||
DomainBase domain,
|
||||
DateTime newExpirationTime,
|
||||
Key<BillingEvent.Recurring> newAutorenewEvent) {
|
||||
assertThat(domain.getTransferData().getTransferStatus())
|
||||
|
@ -323,7 +323,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
GracePeriod.create(
|
||||
GracePeriodStatus.ADD, clock.nowUtc().plusDays(100), "foo", null))
|
||||
.build();
|
||||
DomainResource afterTransfer = domain.cloneProjectedAtTime(clock.nowUtc().plusDays(1));
|
||||
DomainBase afterTransfer = domain.cloneProjectedAtTime(clock.nowUtc().plusDays(1));
|
||||
DateTime newExpirationTime = oldExpirationTime.plusYears(1);
|
||||
Key<BillingEvent.Recurring> serverApproveAutorenewEvent =
|
||||
domain.getTransferData().getServerApproveAutorenewEvent();
|
||||
|
@ -335,7 +335,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
"winner",
|
||||
Key.create(transferBillingEvent)));
|
||||
// If we project after the grace period expires all should be the same except the grace period.
|
||||
DomainResource afterGracePeriod = domain.cloneProjectedAtTime(
|
||||
DomainBase afterGracePeriod = domain.cloneProjectedAtTime(
|
||||
clock.nowUtc().plusDays(2).plus(Registry.get("com").getTransferGracePeriodLength()));
|
||||
assertTransferred(afterGracePeriod, newExpirationTime, serverApproveAutorenewEvent);
|
||||
assertThat(afterGracePeriod.getGracePeriods()).isEmpty();
|
||||
|
@ -381,13 +381,13 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
DateTime transferSuccessDateTime = now.plusDays(5);
|
||||
setupPendingTransferDomain(autorenewDateTime, transferRequestDateTime, transferSuccessDateTime);
|
||||
|
||||
DomainResource beforeAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.minusDays(1));
|
||||
DomainBase beforeAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.minusDays(1));
|
||||
assertThat(beforeAutoRenew.getLastEppUpdateTime()).isEqualTo(transferRequestDateTime);
|
||||
assertThat(beforeAutoRenew.getLastEppUpdateClientId()).isEqualTo("gaining");
|
||||
|
||||
// If autorenew happens before transfer succeeds(before transfer grace period starts as well),
|
||||
// lastEppUpdateClientId should still be the current sponsor client id
|
||||
DomainResource afterAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.plusDays(1));
|
||||
DomainBase afterAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.plusDays(1));
|
||||
assertThat(afterAutoRenew.getLastEppUpdateTime()).isEqualTo(autorenewDateTime);
|
||||
assertThat(afterAutoRenew.getLastEppUpdateClientId()).isEqualTo("losing");
|
||||
}
|
||||
|
@ -400,11 +400,11 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
DateTime transferSuccessDateTime = now.plusDays(5);
|
||||
setupPendingTransferDomain(autorenewDateTime, transferRequestDateTime, transferSuccessDateTime);
|
||||
|
||||
DomainResource beforeAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.minusDays(1));
|
||||
DomainBase beforeAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.minusDays(1));
|
||||
assertThat(beforeAutoRenew.getLastEppUpdateTime()).isEqualTo(transferRequestDateTime);
|
||||
assertThat(beforeAutoRenew.getLastEppUpdateClientId()).isEqualTo("gaining");
|
||||
|
||||
DomainResource afterTransferSuccess =
|
||||
DomainBase afterTransferSuccess =
|
||||
domain.cloneProjectedAtTime(transferSuccessDateTime.plusDays(1));
|
||||
assertThat(afterTransferSuccess.getLastEppUpdateTime()).isEqualTo(transferSuccessDateTime);
|
||||
assertThat(afterTransferSuccess.getLastEppUpdateClientId()).isEqualTo("gaining");
|
||||
|
@ -428,11 +428,11 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
DateTime autorenewDateTime = now.plusDays(3);
|
||||
setupUnmodifiedDomain(autorenewDateTime);
|
||||
|
||||
DomainResource beforeAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.minusDays(1));
|
||||
DomainBase beforeAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.minusDays(1));
|
||||
assertThat(beforeAutoRenew.getLastEppUpdateTime()).isEqualTo(null);
|
||||
assertThat(beforeAutoRenew.getLastEppUpdateClientId()).isEqualTo(null);
|
||||
|
||||
DomainResource afterAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.plusDays(1));
|
||||
DomainBase afterAutoRenew = domain.cloneProjectedAtTime(autorenewDateTime.plusDays(1));
|
||||
assertThat(afterAutoRenew.getLastEppUpdateTime()).isEqualTo(autorenewDateTime);
|
||||
assertThat(afterAutoRenew.getLastEppUpdateClientId()).isEqualTo("losing");
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
|
||||
@Test
|
||||
public void testRenewalsHappenAtExpiration() {
|
||||
DomainResource renewed =
|
||||
DomainBase renewed =
|
||||
domain.cloneProjectedAtTime(domain.getRegistrationExpirationTime());
|
||||
assertThat(renewed.getRegistrationExpirationTime())
|
||||
.isEqualTo(domain.getRegistrationExpirationTime().plusYears(1));
|
||||
|
@ -484,7 +484,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
@Test
|
||||
public void testTldGetsSet() {
|
||||
createTld("tld");
|
||||
domain = newDomainResource("foo.tld");
|
||||
domain = newDomainBase("foo.tld");
|
||||
assertThat(domain.getTld()).isEqualTo("tld");
|
||||
}
|
||||
|
||||
|
@ -493,7 +493,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
domain = domain.asBuilder()
|
||||
.setRegistrationExpirationTime(DateTime.parse("2004-02-29T22:00:00.0Z"))
|
||||
.build();
|
||||
DomainResource renewed =
|
||||
DomainBase renewed =
|
||||
domain.cloneProjectedAtTime(domain.getRegistrationExpirationTime().plusYears(4));
|
||||
assertThat(renewed.getRegistrationExpirationTime().getDayOfMonth()).isEqualTo(28);
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ public class DomainResourceTest extends EntityTestCase {
|
|||
.put(oldExpirationTime.plusYears(2).plusMillis(1), Money.of(USD, 5))
|
||||
.build())
|
||||
.build());
|
||||
DomainResource renewedThreeTimes =
|
||||
DomainBase renewedThreeTimes =
|
||||
domain.cloneProjectedAtTime(oldExpirationTime.plusYears(2));
|
||||
assertThat(renewedThreeTimes.getRegistrationExpirationTime())
|
||||
.isEqualTo(oldExpirationTime.plusYears(3));
|
|
@ -21,7 +21,7 @@ import static google.registry.testing.JUnitBackports.assertThrows;
|
|||
import static google.registry.testing.TestDataHelper.loadBytes;
|
||||
|
||||
import google.registry.model.contact.ContactResourceTest;
|
||||
import google.registry.model.domain.DomainResourceTest;
|
||||
import google.registry.model.domain.DomainBaseTest;
|
||||
import google.registry.model.eppinput.EppInput.InnerCommand;
|
||||
import google.registry.model.eppinput.EppInput.Login;
|
||||
import google.registry.xml.XmlException;
|
||||
|
@ -47,7 +47,7 @@ public class EppInputTest {
|
|||
@Test
|
||||
public void testUnmarshalling_domainCheck() throws Exception {
|
||||
EppInput input =
|
||||
unmarshal(EppInput.class, loadBytes(DomainResourceTest.class, "domain_check.xml").read());
|
||||
unmarshal(EppInput.class, loadBytes(DomainBaseTest.class, "domain_check.xml").read());
|
||||
assertThat(input.getCommandWrapper().getClTrid()).hasValue("ABC-12345");
|
||||
assertThat(input.getCommandType()).isEqualTo("check");
|
||||
assertThat(input.getResourceType()).hasValue("domain");
|
||||
|
|
|
@ -19,7 +19,7 @@ import static com.google.common.truth.Truth8.assertThat;
|
|||
import static google.registry.model.EppResourceUtils.loadByForeignKey;
|
||||
import static google.registry.testing.DatastoreHelper.cloneAndSetAutoTimestamps;
|
||||
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.persistResource;
|
||||
import static google.registry.testing.HostResourceSubject.assertAboutHosts;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -29,7 +29,7 @@ import com.google.common.net.InetAddresses;
|
|||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.transfer.TransferData;
|
||||
|
@ -45,7 +45,7 @@ public class HostResourceTest extends EntityTestCase {
|
|||
final DateTime day2 = day3.minusDays(1);
|
||||
final DateTime day1 = day2.minusDays(1);
|
||||
|
||||
DomainResource domain;
|
||||
DomainBase domain;
|
||||
HostResource host;
|
||||
|
||||
@Before
|
||||
|
@ -54,7 +54,7 @@ public class HostResourceTest extends EntityTestCase {
|
|||
// Set up a new persisted registrar entity.
|
||||
domain =
|
||||
persistResource(
|
||||
newDomainResource("example.com")
|
||||
newDomainBase("example.com")
|
||||
.asBuilder()
|
||||
.setRepoId("1-COM")
|
||||
.setTransferData(
|
||||
|
|
|
@ -44,7 +44,6 @@ import com.googlecode.objectify.annotation.Parent;
|
|||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
|
@ -362,7 +361,7 @@ public class OfyTest {
|
|||
|
||||
@Test
|
||||
public void test_getBaseEntityClassFromEntityOrKey_subclassEntity() {
|
||||
DomainResource domain = DatastoreHelper.newDomainResource("test.tld");
|
||||
DomainBase domain = DatastoreHelper.newDomainBase("test.tld");
|
||||
assertThat(getBaseEntityClassFromEntityOrKey(domain)).isEqualTo(DomainBase.class);
|
||||
assertThat(getBaseEntityClassFromEntityOrKey(Key.create(domain)))
|
||||
.isEqualTo(DomainBase.class);
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.model.reporting;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
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.persistResource;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class HistoryEntryTest extends EntityTestCase {
|
|||
// Set up a new persisted HistoryEntry entity.
|
||||
historyEntry =
|
||||
new HistoryEntry.Builder()
|
||||
.setParent(newDomainResource("foo.foobar"))
|
||||
.setParent(newDomainBase("foo.foobar"))
|
||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
||||
|
|
|
@ -161,26 +161,6 @@ class google.registry.model.domain.DomainAuthInfo {
|
|||
google.registry.model.eppcommon.AuthInfo$PasswordAuth pw;
|
||||
}
|
||||
class google.registry.model.domain.DomainBase {
|
||||
@Id java.lang.String repoId;
|
||||
com.google.common.collect.ImmutableSortedMap<org.joda.time.DateTime, com.googlecode.objectify.Key<google.registry.model.ofy.CommitLogManifest>> revisions;
|
||||
google.registry.model.CreateAutoTimestamp creationTime;
|
||||
google.registry.model.UpdateAutoTimestamp updateTimestamp;
|
||||
google.registry.model.domain.DomainAuthInfo authInfo;
|
||||
google.registry.model.domain.launch.LaunchNotice launchNotice;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String fullyQualifiedDomainName;
|
||||
java.lang.String idnTableName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.lang.String tld;
|
||||
java.util.Set<com.googlecode.objectify.Key<google.registry.model.host.HostResource>> nsHosts;
|
||||
java.util.Set<google.registry.model.domain.DesignatedContact> allContacts;
|
||||
java.util.Set<google.registry.model.domain.secdns.DelegationSignerData> dsData;
|
||||
java.util.Set<google.registry.model.eppcommon.StatusValue> status;
|
||||
org.joda.time.DateTime deletionTime;
|
||||
org.joda.time.DateTime lastEppUpdateTime;
|
||||
}
|
||||
class google.registry.model.domain.DomainResource {
|
||||
@Id java.lang.String repoId;
|
||||
com.google.common.collect.ImmutableSortedMap<org.joda.time.DateTime, com.googlecode.objectify.Key<google.registry.model.ofy.CommitLogManifest>> revisions;
|
||||
com.googlecode.objectify.Key<google.registry.model.billing.BillingEvent$Recurring> autorenewBillingEvent;
|
||||
|
@ -288,7 +268,7 @@ class google.registry.model.eppcommon.Trid {
|
|||
class google.registry.model.host.HostResource {
|
||||
@Id java.lang.String repoId;
|
||||
com.google.common.collect.ImmutableSortedMap<org.joda.time.DateTime, com.googlecode.objectify.Key<google.registry.model.ofy.CommitLogManifest>> revisions;
|
||||
com.googlecode.objectify.Key<google.registry.model.domain.DomainResource> superordinateDomain;
|
||||
com.googlecode.objectify.Key<google.registry.model.domain.DomainBase> superordinateDomain;
|
||||
google.registry.model.CreateAutoTimestamp creationTime;
|
||||
google.registry.model.UpdateAutoTimestamp updateTimestamp;
|
||||
java.lang.String creationClientId;
|
||||
|
|
|
@ -20,7 +20,7 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import static google.registry.testing.DatastoreHelper.persistSimpleResources;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainBase;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHistoryEntry;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts;
|
||||
|
@ -95,13 +95,13 @@ public class RdapDomainActionTest extends RdapActionBaseTestCase<RdapDomainActio
|
|||
HostResource host2 = makeAndPersistHostResource(
|
||||
"ns2.cat.lol", "bad:f00d:cafe:0:0:0:15:beef", clock.nowUtc().minusYears(2));
|
||||
DomainBase domainCatLol =
|
||||
persistResource(makeDomainResource("cat.lol",
|
||||
persistResource(makeDomainBase("cat.lol",
|
||||
registrantLol, adminContactLol, techContactLol, host1, host2, registrarLol));
|
||||
|
||||
// deleted domain in lol
|
||||
HostResource hostDodo2 = makeAndPersistHostResource(
|
||||
"ns2.dodo.lol", "bad:f00d:cafe:0:0:0:15:beef", clock.nowUtc().minusYears(2));
|
||||
DomainBase domainDeleted = persistResource(makeDomainResource("dodo.lol",
|
||||
DomainBase domainDeleted = persistResource(makeDomainBase("dodo.lol",
|
||||
makeAndPersistContactResource(
|
||||
"5372808-ERL",
|
||||
"Goblin Market",
|
||||
|
@ -150,7 +150,7 @@ public class RdapDomainActionTest extends RdapActionBaseTestCase<RdapDomainActio
|
|||
"bog@cat.lol",
|
||||
clock.nowUtc().minusYears(3),
|
||||
registrarIdn);
|
||||
DomainBase domainCatIdn = persistResource(makeDomainResource("cat.みんな",
|
||||
DomainBase domainCatIdn = persistResource(makeDomainBase("cat.みんな",
|
||||
registrantIdn,
|
||||
adminContactIdn,
|
||||
techContactIdn,
|
||||
|
@ -184,7 +184,7 @@ public class RdapDomainActionTest extends RdapActionBaseTestCase<RdapDomainActio
|
|||
"bog@cat.lol",
|
||||
clock.nowUtc().minusYears(3),
|
||||
registrar1Tld);
|
||||
DomainBase domainCat1Tld = persistResource(makeDomainResource("cat.1.tld",
|
||||
DomainBase domainCat1Tld = persistResource(makeDomainBase("cat.1.tld",
|
||||
registrant1Tld,
|
||||
adminContact1Tld,
|
||||
techContact1Tld,
|
||||
|
|
|
@ -24,7 +24,7 @@ import static google.registry.testing.DatastoreHelper.persistResources;
|
|||
import static google.registry.testing.DatastoreHelper.persistSimpleResources;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainBase;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHistoryEntry;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts;
|
||||
|
@ -38,7 +38,7 @@ import com.google.common.collect.Range;
|
|||
import com.google.common.net.InetAddresses;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -75,11 +75,11 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
}
|
||||
|
||||
private Registrar registrar;
|
||||
private DomainResource domainCatLol;
|
||||
private DomainResource domainCatLol2;
|
||||
private DomainResource domainCatExample;
|
||||
private DomainResource domainIdn;
|
||||
private DomainResource domainMultipart;
|
||||
private DomainBase domainCatLol;
|
||||
private DomainBase domainCatLol2;
|
||||
private DomainBase domainCatExample;
|
||||
private DomainBase domainIdn;
|
||||
private DomainBase domainMultipart;
|
||||
private ContactResource contact1;
|
||||
private ContactResource contact2;
|
||||
private ContactResource contact3;
|
||||
|
@ -154,7 +154,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
makeRegistrar("evilregistrar", "Yes Virginia <script>", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
domainCatLol = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat.lol",
|
||||
contact1 = makeAndPersistContactResource(
|
||||
"5372808-ERL",
|
||||
|
@ -192,7 +192,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
persistResource(
|
||||
hostNs2CatLol.asBuilder().setSuperordinateDomain(Key.create(domainCatLol)).build());
|
||||
domainCatLol2 = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat2.lol",
|
||||
makeAndPersistContactResource(
|
||||
"6372808-ERL",
|
||||
|
@ -226,7 +226,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
makeRegistrar("goodregistrar", "St. John Chrysostom", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
domainCatExample = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat.example",
|
||||
makeAndPersistContactResource(
|
||||
"7372808-ERL",
|
||||
|
@ -258,7 +258,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
registrar = persistResource(makeRegistrar("unicoderegistrar", "みんな", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
domainIdn = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat.みんな",
|
||||
makeAndPersistContactResource(
|
||||
"8372808-ERL",
|
||||
|
@ -291,7 +291,7 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
registrar =
|
||||
persistResource(makeRegistrar("multiregistrar", "1.test", Registrar.State.ACTIVE));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
domainMultipart = persistResource(makeDomainResource(
|
||||
domainMultipart = persistResource(makeDomainBase(
|
||||
"cat.1.test",
|
||||
makeAndPersistContactResource(
|
||||
"9372808-ERL",
|
||||
|
@ -540,11 +540,11 @@ public class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDom
|
|||
}
|
||||
ImmutableSet<Key<HostResource>> hostKeys = hostKeysBuilder.build();
|
||||
// Create all the domains at once, then persist them in parallel, for increased efficiency.
|
||||
ImmutableList.Builder<DomainResource> domainsBuilder = new ImmutableList.Builder<>();
|
||||
ImmutableList.Builder<DomainBase> domainsBuilder = new ImmutableList.Builder<>();
|
||||
for (int i = numActiveDomains * numTotalDomainsPerActiveDomain; i >= 1; i--) {
|
||||
String domainName = String.format("domain%d.lol", i);
|
||||
DomainResource.Builder builder =
|
||||
makeDomainResource(
|
||||
DomainBase.Builder builder =
|
||||
makeDomainBase(
|
||||
domainName, contact1, contact2, contact3, null, null, registrar)
|
||||
.asBuilder()
|
||||
.setNameservers(hostKeys)
|
||||
|
|
|
@ -20,7 +20,7 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import static google.registry.testing.DatastoreHelper.persistSimpleResources;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistDeletedContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainBase;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts;
|
||||
|
@ -94,7 +94,7 @@ public class RdapEntityActionTest extends RdapActionBaseTestCase<RdapEntityActio
|
|||
persistResource(makeHostResource("ns1.cat.lol", "1.2.3.4"));
|
||||
HostResource host2 =
|
||||
persistResource(makeHostResource("ns2.cat.lol", "bad:f00d:cafe:0:0:0:15:beef"));
|
||||
persistResource(makeDomainResource("cat.lol",
|
||||
persistResource(makeDomainBase("cat.lol",
|
||||
registrant,
|
||||
adminContact,
|
||||
techContact,
|
||||
|
|
|
@ -20,7 +20,7 @@ import static google.registry.testing.DatastoreHelper.persistResource;
|
|||
import static google.registry.testing.DatastoreHelper.persistSimpleResources;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainBase;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHistoryEntry;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
|
||||
import static google.registry.testing.TestDataHelper.loadFile;
|
||||
|
@ -33,7 +33,7 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.config.RdapNoticeDescriptor;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -71,8 +71,8 @@ public class RdapJsonFormatterTest {
|
|||
private RdapJsonFormatter rdapJsonFormatter;
|
||||
|
||||
private Registrar registrar;
|
||||
private DomainResource domainResourceFull;
|
||||
private DomainResource domainResourceNoNameservers;
|
||||
private DomainBase domainBaseFull;
|
||||
private DomainBase domainBaseNoNameservers;
|
||||
private HostResource hostResourceIpv4;
|
||||
private HostResource hostResourceIpv6;
|
||||
private HostResource hostResourceBoth;
|
||||
|
@ -163,7 +163,7 @@ public class RdapJsonFormatterTest {
|
|||
.setSuperordinateDomain(
|
||||
Key.create(
|
||||
persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"dog.みんな",
|
||||
contactResourceRegistrant,
|
||||
contactResourceAdmin,
|
||||
|
@ -186,8 +186,8 @@ public class RdapJsonFormatterTest {
|
|||
.build())
|
||||
.build())))
|
||||
.build());
|
||||
domainResourceFull = persistResource(
|
||||
makeDomainResource(
|
||||
domainBaseFull = persistResource(
|
||||
makeDomainBase(
|
||||
"cat.みんな",
|
||||
contactResourceRegistrant,
|
||||
contactResourceAdmin,
|
||||
|
@ -195,8 +195,8 @@ public class RdapJsonFormatterTest {
|
|||
hostResourceIpv4,
|
||||
hostResourceIpv6,
|
||||
registrar));
|
||||
domainResourceNoNameservers = persistResource(
|
||||
makeDomainResource(
|
||||
domainBaseNoNameservers = persistResource(
|
||||
makeDomainBase(
|
||||
"fish.みんな",
|
||||
contactResourceRegistrant,
|
||||
contactResourceAdmin,
|
||||
|
@ -208,7 +208,7 @@ public class RdapJsonFormatterTest {
|
|||
// Create an unused domain that references hostResourceBoth and hostResourceNoAddresses so that
|
||||
// they will have "associated" (ie, StatusValue.LINKED) status.
|
||||
persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"dog.みんな",
|
||||
contactResourceRegistrant,
|
||||
contactResourceAdmin,
|
||||
|
@ -220,14 +220,14 @@ public class RdapJsonFormatterTest {
|
|||
// history entries
|
||||
persistResource(
|
||||
makeHistoryEntry(
|
||||
domainResourceFull,
|
||||
domainBaseFull,
|
||||
HistoryEntry.Type.DOMAIN_CREATE,
|
||||
Period.create(1, Period.Unit.YEARS),
|
||||
"created",
|
||||
clock.nowUtc()));
|
||||
persistResource(
|
||||
makeHistoryEntry(
|
||||
domainResourceNoNameservers,
|
||||
domainBaseNoNameservers,
|
||||
HistoryEntry.Type.DOMAIN_CREATE,
|
||||
Period.create(1, Period.Unit.YEARS),
|
||||
"created",
|
||||
|
@ -516,7 +516,7 @@ public class RdapJsonFormatterTest {
|
|||
@Test
|
||||
public void testDomain_full() {
|
||||
assertThat(rdapJsonFormatter.makeRdapJsonForDomain(
|
||||
domainResourceFull,
|
||||
domainBaseFull,
|
||||
false,
|
||||
LINK_BASE,
|
||||
WHOIS_SERVER,
|
||||
|
@ -529,7 +529,7 @@ public class RdapJsonFormatterTest {
|
|||
@Test
|
||||
public void testDomain_summary() {
|
||||
assertThat(rdapJsonFormatter.makeRdapJsonForDomain(
|
||||
domainResourceFull,
|
||||
domainBaseFull,
|
||||
false,
|
||||
LINK_BASE,
|
||||
WHOIS_SERVER,
|
||||
|
@ -542,7 +542,7 @@ public class RdapJsonFormatterTest {
|
|||
@Test
|
||||
public void testDomain_logged_out() {
|
||||
assertThat(rdapJsonFormatter.makeRdapJsonForDomain(
|
||||
domainResourceFull,
|
||||
domainBaseFull,
|
||||
false,
|
||||
LINK_BASE,
|
||||
WHOIS_SERVER,
|
||||
|
@ -555,7 +555,7 @@ public class RdapJsonFormatterTest {
|
|||
@Test
|
||||
public void testDomain_noNameservers() {
|
||||
assertThat(rdapJsonFormatter.makeRdapJsonForDomain(
|
||||
domainResourceNoNameservers,
|
||||
domainBaseNoNameservers,
|
||||
false,
|
||||
LINK_BASE,
|
||||
WHOIS_SERVER,
|
||||
|
|
|
@ -22,7 +22,7 @@ import static google.registry.testing.DatastoreHelper.persistResources;
|
|||
import static google.registry.testing.DatastoreHelper.persistSimpleResources;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeAndPersistHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainBase;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts;
|
||||
|
@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableListMultimap;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import google.registry.rdap.RdapMetrics.EndpointType;
|
||||
|
@ -61,7 +61,7 @@ public class RdapNameserverSearchActionTest
|
|||
super(RdapNameserverSearchAction.class, RdapNameserverSearchAction.PATH);
|
||||
}
|
||||
|
||||
private DomainResource domainCatLol;
|
||||
private DomainBase domainCatLol;
|
||||
private HostResource hostNs1CatLol;
|
||||
private HostResource hostNs2CatLol;
|
||||
|
||||
|
@ -133,7 +133,7 @@ public class RdapNameserverSearchActionTest
|
|||
|
||||
// create a domain so that we can use it as a test nameserver search string suffix
|
||||
domainCatLol = persistResource(
|
||||
makeDomainResource(
|
||||
makeDomainBase(
|
||||
"cat.lol",
|
||||
persistResource(
|
||||
makeContactResource("5372808-ERL", "Goblin Market", "lol@cat.lol", registrar)),
|
||||
|
|
|
@ -18,7 +18,7 @@ import static com.google.common.io.BaseEncoding.base16;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
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.persistEppResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
|
@ -40,7 +40,7 @@ import google.registry.model.contact.ContactResource;
|
|||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
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;
|
||||
|
@ -77,13 +77,13 @@ import org.junit.runner.RunWith;
|
|||
import org.junit.runners.JUnit4;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link DomainResourceToXjcConverter}.
|
||||
* Unit tests for {@link DomainBaseToXjcConverter}.
|
||||
*
|
||||
* <p>This tests the mapping between {@link DomainResource} and {@link XjcRdeDomain} as well as
|
||||
* <p>This tests the mapping between {@link DomainBase} and {@link XjcRdeDomain} as well as
|
||||
* some exceptional conditions.
|
||||
*/
|
||||
@RunWith(JUnit4.class)
|
||||
public class DomainResourceToXjcConverterTest {
|
||||
public class DomainBaseToXjcConverterTest {
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
|
@ -101,7 +101,7 @@ public class DomainResourceToXjcConverterTest {
|
|||
@Test
|
||||
public void testConvertThick() {
|
||||
XjcRdeDomain bean =
|
||||
DomainResourceToXjcConverter.convertDomain(makeDomainResource(clock), RdeMode.FULL);
|
||||
DomainBaseToXjcConverter.convertDomain(makeDomainBase(clock), RdeMode.FULL);
|
||||
|
||||
assertThat(bean.getClID()).isEqualTo("GetTheeBack");
|
||||
|
||||
|
@ -184,7 +184,7 @@ public class DomainResourceToXjcConverterTest {
|
|||
@Test
|
||||
public void testConvertThin() {
|
||||
XjcRdeDomain bean =
|
||||
DomainResourceToXjcConverter.convertDomain(makeDomainResource(clock), RdeMode.THIN);
|
||||
DomainBaseToXjcConverter.convertDomain(makeDomainBase(clock), RdeMode.THIN);
|
||||
assertThat(bean.getRegistrant()).isNull();
|
||||
assertThat(bean.getContacts()).isEmpty();
|
||||
assertThat(bean.getSecDNS()).isNull();
|
||||
|
@ -193,14 +193,14 @@ public class DomainResourceToXjcConverterTest {
|
|||
@Test
|
||||
public void testMarshalThick() throws Exception {
|
||||
XjcRdeDomain bean =
|
||||
DomainResourceToXjcConverter.convertDomain(makeDomainResource(clock), RdeMode.FULL);
|
||||
DomainBaseToXjcConverter.convertDomain(makeDomainBase(clock), RdeMode.FULL);
|
||||
wrapDeposit(bean).marshal(new ByteArrayOutputStream(), UTF_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMarshalThin() throws Exception {
|
||||
XjcRdeDomain bean =
|
||||
DomainResourceToXjcConverter.convertDomain(makeDomainResource(clock), RdeMode.THIN);
|
||||
DomainBaseToXjcConverter.convertDomain(makeDomainBase(clock), RdeMode.THIN);
|
||||
wrapDeposit(bean).marshal(new ByteArrayOutputStream(), UTF_8);
|
||||
}
|
||||
|
||||
|
@ -221,9 +221,9 @@ public class DomainResourceToXjcConverterTest {
|
|||
return deposit;
|
||||
}
|
||||
|
||||
static DomainResource makeDomainResource(FakeClock clock) {
|
||||
DomainResource domain =
|
||||
newDomainResource("example.xn--q9jyb4c").asBuilder().setRepoId("2-Q9JYB4C").build();
|
||||
static DomainBase makeDomainBase(FakeClock clock) {
|
||||
DomainBase domain =
|
||||
newDomainBase("example.xn--q9jyb4c").asBuilder().setRepoId("2-Q9JYB4C").build();
|
||||
HistoryEntry historyEntry =
|
||||
persistResource(new HistoryEntry.Builder().setParent(domain).build());
|
||||
BillingEvent.OneTime billingEvent = persistResource(
|
|
@ -16,7 +16,7 @@ package google.registry.rde;
|
|||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
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.JUnitBackports.assertThrows;
|
||||
import static google.registry.xjc.XjcXmlTransformer.marshalStrict;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
@ -24,7 +24,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import com.googlecode.objectify.Key;
|
||||
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.testing.AppEngineRule;
|
||||
|
@ -61,7 +61,7 @@ public class HostResourceToXjcConverterTest {
|
|||
|
||||
@Test
|
||||
public void testConvertSubordinateHost() {
|
||||
DomainResource domain = newDomainResource("love.foobar").asBuilder()
|
||||
DomainBase domain = newDomainBase("love.foobar").asBuilder()
|
||||
.setPersistedCurrentSponsorClientId("LeisureDog")
|
||||
.setLastTransferTime(DateTime.parse("2010-01-01T00:00:00Z"))
|
||||
.addStatusValue(StatusValue.PENDING_TRANSFER)
|
||||
|
|
|
@ -36,7 +36,7 @@ import google.registry.model.contact.ContactResource;
|
|||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
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;
|
||||
|
@ -57,8 +57,8 @@ import org.joda.time.DateTime;
|
|||
/** Utility class for creating {@code EppResource} entities that'll successfully marshal. */
|
||||
final class RdeFixtures {
|
||||
|
||||
static DomainResource makeDomainResource(FakeClock clock, String tld) {
|
||||
DomainResource domain = new DomainResource.Builder()
|
||||
static DomainBase makeDomainBase(FakeClock clock, String tld) {
|
||||
DomainBase domain = new DomainBase.Builder()
|
||||
.setFullyQualifiedDomainName("example." + tld)
|
||||
.setRepoId(generateNewDomainRoid(tld))
|
||||
.setRegistrant(Key.create(
|
||||
|
|
|
@ -20,7 +20,7 @@ import static google.registry.model.common.Cursor.CursorType.BRDA;
|
|||
import static google.registry.model.common.Cursor.CursorType.RDE_STAGING;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.rde.RdeFixtures.makeContactResource;
|
||||
import static google.registry.rde.RdeFixtures.makeDomainResource;
|
||||
import static google.registry.rde.RdeFixtures.makeDomainBase;
|
||||
import static google.registry.rde.RdeFixtures.makeHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -322,7 +322,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_bunchOfResources_headerHasCorrectCounts() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("lol");
|
||||
makeDomainResource(clock, "lol");
|
||||
makeDomainBase(clock, "lol");
|
||||
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.run();
|
||||
|
@ -417,7 +417,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_sameDayRdeDeposit_advancesCursorToTomorrow() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("lol");
|
||||
makeDomainResource(clock, "lol");
|
||||
makeDomainBase(clock, "lol");
|
||||
setCursor(Registry.get("lol"), RDE_STAGING, DateTime.parse("2000-01-01TZ"));
|
||||
setCursor(Registry.get("lol"), BRDA, DateTime.parse("2000-01-04TZ"));
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ")); // Saturday
|
||||
|
@ -438,7 +438,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_onBrdaDay_advancesBothCursors() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("lol");
|
||||
makeDomainResource(clock, "lol");
|
||||
makeDomainBase(clock, "lol");
|
||||
setCursor(Registry.get("lol"), RDE_STAGING, DateTime.parse("2000-01-04TZ"));
|
||||
setCursor(Registry.get("lol"), BRDA, DateTime.parse("2000-01-04TZ"));
|
||||
clock.setTo(DateTime.parse("2000-01-04TZ")); // Tuesday
|
||||
|
@ -459,7 +459,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_onBrdaDay_enqueuesBothTasks() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("lol");
|
||||
makeDomainResource(clock, "lol");
|
||||
makeDomainBase(clock, "lol");
|
||||
setCursor(Registry.get("lol"), RDE_STAGING, DateTime.parse("2000-01-04TZ"));
|
||||
setCursor(Registry.get("lol"), BRDA, DateTime.parse("2000-01-04TZ"));
|
||||
clock.setTo(DateTime.parse("2000-01-04TZ")); // Tuesday
|
||||
|
@ -515,7 +515,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_idnTables_goInDeposit() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("fop");
|
||||
makeDomainResource(clock, "fop");
|
||||
makeDomainBase(clock, "fop");
|
||||
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.run();
|
||||
|
@ -541,7 +541,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_withDomain_producesExpectedXml() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("lol");
|
||||
makeDomainResource(clock, "lol");
|
||||
makeDomainBase(clock, "lol");
|
||||
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.run();
|
||||
|
@ -558,7 +558,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_withDomain_producesCorrectLengthFile() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("lol");
|
||||
makeDomainResource(clock, "lol");
|
||||
makeDomainBase(clock, "lol");
|
||||
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.run();
|
||||
|
@ -573,7 +573,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_withDomain_producesReportXml() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("lol");
|
||||
makeDomainResource(clock, "lol");
|
||||
makeDomainBase(clock, "lol");
|
||||
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.run();
|
||||
|
@ -590,9 +590,9 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
public void testMapReduce_twoDomainsDifferentTlds_isolatesDomains() throws Exception {
|
||||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
createTldWithEscrowEnabled("boggle");
|
||||
makeDomainResource(clock, "boggle");
|
||||
makeDomainBase(clock, "boggle");
|
||||
createTldWithEscrowEnabled("lol");
|
||||
makeDomainResource(clock, "lol");
|
||||
makeDomainBase(clock, "lol");
|
||||
|
||||
clock.setTo(DateTime.parse("2000-01-01TZ"));
|
||||
action.run();
|
||||
|
@ -746,7 +746,7 @@ public class RdeStagingActionTest extends MapreduceTestCase<RdeStagingAction> {
|
|||
clock.setTo(DateTime.parse("1999-12-31TZ"));
|
||||
for (String tld : tlds) {
|
||||
createTldWithEscrowEnabled(tld);
|
||||
makeDomainResource(clock, tld);
|
||||
makeDomainBase(clock, tld);
|
||||
setCursor(Registry.get(tld), RDE_STAGING, DateTime.parse("1999-01-01TZ"));
|
||||
setCursor(Registry.get(tld), BRDA, DateTime.parse("2001-01-01TZ"));
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.junit.runners.Suite.SuiteClasses;
|
|||
/** Convenience class to run all RDE tests inside IDE with one keystroke. */
|
||||
@RunWith(Suite.class)
|
||||
@SuiteClasses({
|
||||
DomainResourceToXjcConverterTest.class,
|
||||
DomainBaseToXjcConverterTest.class,
|
||||
GhostrydeGpgIntegrationTest.class,
|
||||
GhostrydeTest.class,
|
||||
HostResourceToXjcConverterTest.class,
|
||||
|
|
|
@ -19,7 +19,7 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
|
|||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.getHistoryEntries;
|
||||
import static google.registry.testing.DatastoreHelper.getPollMessages;
|
||||
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.persistResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistSimpleResource;
|
||||
|
@ -40,7 +40,7 @@ import google.registry.config.RegistryConfig.ConfigModule;
|
|||
import google.registry.gcs.GcsUtils;
|
||||
import google.registry.mapreduce.MapreduceRunner;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
|
@ -108,7 +108,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
public void testMapreduceSuccessfullyImportsDomain() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_DOMAIN);
|
||||
runMapreduce();
|
||||
List<DomainResource> domains = ofy().load().type(DomainResource.class).list();
|
||||
List<DomainBase> domains = ofy().load().type(DomainBase.class).list();
|
||||
assertThat(domains).hasSize(1);
|
||||
checkDomain(domains.get(0));
|
||||
}
|
||||
|
@ -117,8 +117,8 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
public void testMapreduceSuccessfullyCreatesHistoryEntry() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_DOMAIN);
|
||||
runMapreduce();
|
||||
List<DomainResource> domains = ofy().load().type(DomainResource.class).list();
|
||||
DomainResource domain = domains.get(0);
|
||||
List<DomainBase> domains = ofy().load().type(DomainBase.class).list();
|
||||
DomainBase domain = domains.get(0);
|
||||
// verify history entry
|
||||
List<HistoryEntry> historyEntries = getHistoryEntries(domain);
|
||||
assertThat(historyEntries).hasSize(1);
|
||||
|
@ -130,9 +130,9 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
public void testMapreduceTwiceDoesNotDuplicateResources() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_DOMAIN);
|
||||
// Create domain and history entry first
|
||||
DomainResource existingDomain =
|
||||
DomainBase existingDomain =
|
||||
persistResource(
|
||||
newDomainResource("example1.test").asBuilder().setRepoId("Dexample1-TEST").build());
|
||||
newDomainBase("example1.test").asBuilder().setRepoId("Dexample1-TEST").build());
|
||||
persistSimpleResource(createHistoryEntry(
|
||||
existingDomain.getRepoId(),
|
||||
existingDomain.getCurrentSponsorClientId(),
|
||||
|
@ -141,9 +141,9 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
// aren't imported twice (only one domain, and one history entry)
|
||||
pushToGcs(DEPOSIT_1_DOMAIN);
|
||||
runMapreduce();
|
||||
List<DomainResource> domains = ofy().load().type(DomainResource.class).list();
|
||||
List<DomainBase> domains = ofy().load().type(DomainBase.class).list();
|
||||
assertThat(domains.size()).isEqualTo(1);
|
||||
DomainResource domain = domains.get(0);
|
||||
DomainBase domain = domains.get(0);
|
||||
// verify history entry
|
||||
List<HistoryEntry> historyEntries = getHistoryEntries(domain);
|
||||
assertThat(historyEntries).hasSize(1);
|
||||
|
@ -165,13 +165,13 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
public void testMapreducePendingTransferServerApproval() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_DOMAIN_PENDING_TRANSFER);
|
||||
runMapreduce();
|
||||
List<DomainResource> domains = ofy().load().type(DomainResource.class).list();
|
||||
List<DomainBase> domains = ofy().load().type(DomainBase.class).list();
|
||||
assertThat(domains).hasSize(1);
|
||||
checkDomain(domains.get(0));
|
||||
// implicit server approval happens at 2015-01-08T22:00:00.0Z
|
||||
DateTime serverApprovalTime = DateTime.parse("2015-01-08T22:00:00.0Z");
|
||||
// Domain should be assigned to RegistrarX before server approval
|
||||
DomainResource beforeApproval =
|
||||
DomainBase beforeApproval =
|
||||
domains.get(0).cloneProjectedAtTime(serverApprovalTime.minus(Seconds.ONE));
|
||||
assertThat(beforeApproval.getCurrentSponsorClientId()).isEqualTo("RegistrarX");
|
||||
assertThat(loadAutorenewBillingEventForDomain(beforeApproval).getClientId())
|
||||
|
@ -199,7 +199,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
DateTime.parse("2015-01-08T22:00:00.0Z"));
|
||||
|
||||
// Domain should be assigned to RegistrarY after server approval
|
||||
DomainResource afterApproval =
|
||||
DomainBase afterApproval =
|
||||
domains.get(0).cloneProjectedAtTime(serverApprovalTime);
|
||||
assertThat(afterApproval.getCurrentSponsorClientId()).isEqualTo("RegistrarY");
|
||||
assertThat(loadAutorenewBillingEventForDomain(afterApproval).getClientId())
|
||||
|
@ -227,12 +227,12 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
DateTime serverApprovalTime = DateTime.parse("2015-02-03T22:00:00.0Z");
|
||||
pushToGcs(DEPOSIT_1_DOMAIN_PENDING_TRANSFER_REG_CAP);
|
||||
runMapreduce();
|
||||
List<DomainResource> domains = ofy().load().type(DomainResource.class).list();
|
||||
List<DomainBase> domains = ofy().load().type(DomainBase.class).list();
|
||||
assertThat(domains).hasSize(1);
|
||||
checkDomain(domains.get(0));
|
||||
|
||||
// Domain should be assigned to RegistrarX before server approval
|
||||
DomainResource beforeApproval =
|
||||
DomainBase beforeApproval =
|
||||
domains.get(0).cloneProjectedAtTime(serverApprovalTime.minus(Seconds.ONE));
|
||||
assertThat(beforeApproval.getCurrentSponsorClientId()).isEqualTo("RegistrarX");
|
||||
assertThat(loadAutorenewBillingEventForDomain(beforeApproval).getClientId())
|
||||
|
@ -244,7 +244,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
.isEqualTo(DateTime.parse("2024-04-03T22:00:00.0Z"));
|
||||
|
||||
// Domain should be assigned to RegistrarY after server approval
|
||||
DomainResource afterApproval =
|
||||
DomainBase afterApproval =
|
||||
domains.get(0).cloneProjectedAtTime(serverApprovalTime);
|
||||
assertThat(afterApproval.getCurrentSponsorClientId()).isEqualTo("RegistrarY");
|
||||
// New expiration should be capped at 10 years from server approval time, which is 2025-02-03,
|
||||
|
@ -268,7 +268,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
public void testMapreducePendingTransferEvents() throws Exception {
|
||||
pushToGcs(DEPOSIT_1_DOMAIN_PENDING_TRANSFER);
|
||||
runMapreduce();
|
||||
List<DomainResource> domains = ofy().load().type(DomainResource.class).list();
|
||||
List<DomainBase> domains = ofy().load().type(DomainBase.class).list();
|
||||
assertThat(domains).hasSize(1);
|
||||
checkDomain(domains.get(0));
|
||||
checkTransferRequestPollMessage(
|
||||
|
@ -289,7 +289,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
}
|
||||
|
||||
private static void checkTransferBillingEvent(
|
||||
DomainResource domain, DateTime automaticTransferTime) {
|
||||
DomainBase domain, DateTime automaticTransferTime) {
|
||||
for (BillingEvent.OneTime event :
|
||||
ofy().load().type(BillingEvent.OneTime.class).ancestor(domain).list()) {
|
||||
if (event.getReason() == BillingEvent.Reason.TRANSFER) {
|
||||
|
@ -302,7 +302,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
|
||||
/** Verifies the existence of a transfer request poll message */
|
||||
private static void checkTransferRequestPollMessage(
|
||||
DomainResource domain, String clientId, DateTime expectedAt, DateTime expectedExpiration) {
|
||||
DomainBase domain, String clientId, DateTime expectedAt, DateTime expectedExpiration) {
|
||||
for (PollMessage message : getPollMessages(domain)) {
|
||||
if (TransferStatus.PENDING.getMessage().equals(message.getMsg())
|
||||
&& clientId.equals(message.getClientId())
|
||||
|
@ -321,7 +321,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
|
||||
/** Verifies the existence of a transfer server approved poll message */
|
||||
private static void checkTransferServerApprovalPollMessage(
|
||||
DomainResource domain, String clientId, DateTime expectedAt) {
|
||||
DomainBase domain, String clientId, DateTime expectedAt) {
|
||||
for (PollMessage message : getPollMessages(domain)) {
|
||||
if (TransferStatus.SERVER_APPROVED.getMessage().equals(message.getMsg())
|
||||
&& clientId.equals(message.getClientId())
|
||||
|
@ -334,7 +334,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
|
||||
/** Verifies autorenew {@link PollMessage} is correct */
|
||||
private static void checkAutorenewPollMessage(
|
||||
DomainResource domain, String clientId, DateTime expectedAt, DateTime recurrenceEndTime) {
|
||||
DomainBase domain, String clientId, DateTime expectedAt, DateTime recurrenceEndTime) {
|
||||
PollMessage.Autorenew autorenewPollMessage = loadAutorenewPollMessageForDomain(domain);
|
||||
assertThat(autorenewPollMessage).isNotNull();
|
||||
assertThat(autorenewPollMessage.getClientId()).isEqualTo(clientId);
|
||||
|
@ -344,7 +344,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
|
||||
/** Verifies autorenew {@link BillingEvent} is correct */
|
||||
private static void checkAutorenewBillingEvent(
|
||||
DomainResource domain, String clientId, DateTime expectedAt, DateTime recurrenceEndTime) {
|
||||
DomainBase domain, String clientId, DateTime expectedAt, DateTime recurrenceEndTime) {
|
||||
BillingEvent.Recurring autorenewBillingEvent = loadAutorenewBillingEventForDomain(domain);
|
||||
assertThat(autorenewBillingEvent).isNotNull();
|
||||
assertThat(autorenewBillingEvent.getClientId()).isEqualTo(clientId);
|
||||
|
@ -353,7 +353,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
}
|
||||
|
||||
/** Verify history entry fields are correct */
|
||||
private static void checkHistoryEntry(HistoryEntry entry, DomainResource parent) {
|
||||
private static void checkHistoryEntry(HistoryEntry entry, DomainBase parent) {
|
||||
assertThat(entry.getType()).isEqualTo(HistoryEntry.Type.RDE_IMPORT);
|
||||
assertThat(entry.getClientId()).isEqualTo(parent.getCurrentSponsorClientId());
|
||||
assertThat(entry.getXmlBytes().length).isGreaterThan(0);
|
||||
|
@ -364,7 +364,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
}
|
||||
|
||||
/** Verifies that domain fields match expected values */
|
||||
private static void checkDomain(DomainResource domain) {
|
||||
private static void checkDomain(DomainBase domain) {
|
||||
assertThat(domain.getFullyQualifiedDomainName()).isEqualTo("example1.test");
|
||||
assertThat(domain.getRepoId()).isEqualTo("Dexample1-TEST");
|
||||
}
|
||||
|
@ -392,12 +392,12 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
}
|
||||
|
||||
@Nullable
|
||||
private static BillingEvent.Recurring loadAutorenewBillingEventForDomain(DomainResource domain) {
|
||||
private static BillingEvent.Recurring loadAutorenewBillingEventForDomain(DomainBase domain) {
|
||||
return ofy().load().key(domain.getAutorenewBillingEvent()).now();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static PollMessage.Autorenew loadAutorenewPollMessageForDomain(DomainResource domain) {
|
||||
private static PollMessage.Autorenew loadAutorenewPollMessageForDomain(DomainBase domain) {
|
||||
return ofy().load().key(domain.getAutorenewPollMessage()).now();
|
||||
}
|
||||
|
||||
|
@ -411,7 +411,7 @@ public class RdeDomainImportActionTest extends MapreduceTestCase<RdeDomainImport
|
|||
.setBySuperuser(true)
|
||||
.setReason("RDE Import")
|
||||
.setRequestedByRegistrar(false)
|
||||
.setParent(Key.create(null, DomainResource.class, roid))
|
||||
.setParent(Key.create(null, DomainBase.class, roid))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ import static google.registry.model.eppcommon.StatusValue.PENDING_DELETE;
|
|||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.rde.imports.RdeImportsTestData.loadBytes;
|
||||
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.newHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -36,7 +36,7 @@ import com.googlecode.objectify.Key;
|
|||
import google.registry.config.RegistryConfig.ConfigModule;
|
||||
import google.registry.gcs.GcsUtils;
|
||||
import google.registry.mapreduce.MapreduceRunner;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.ForeignKeyIndex.ForeignKeyDomainIndex;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
|
@ -98,8 +98,8 @@ public class RdeHostLinkActionTest extends MapreduceTestCase<RdeHostLinkAction>
|
|||
.asBuilder()
|
||||
.setRepoId("Hns1_example1_test-TEST")
|
||||
.build());
|
||||
DomainResource superordinateDomain = persistActiveDomain("example1.test");
|
||||
Key<DomainResource> superOrdinateDomainKey = Key.create(superordinateDomain);
|
||||
DomainBase superordinateDomain = persistActiveDomain("example1.test");
|
||||
Key<DomainBase> superOrdinateDomainKey = Key.create(superordinateDomain);
|
||||
pushToGcs(DEPOSIT_1_HOST);
|
||||
// set transaction time to slightly after resource save
|
||||
clock.advanceOneMilli();
|
||||
|
@ -111,7 +111,7 @@ public class RdeHostLinkActionTest extends MapreduceTestCase<RdeHostLinkAction>
|
|||
assertThat(hosts.get(0).getLastSuperordinateChange())
|
||||
.isEqualTo(DateTime.parse("2016-05-07T14:55:38.001Z"));
|
||||
// verify that domain is linked to host
|
||||
List<DomainResource> domains = ofy().load().type(DomainResource.class).list();
|
||||
List<DomainBase> domains = ofy().load().type(DomainBase.class).list();
|
||||
assertThat(domains).hasSize(1);
|
||||
assertThat(domains.get(0).getSubordinateHosts()).containsExactly("ns1.example1.test");
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public class RdeHostLinkActionTest extends MapreduceTestCase<RdeHostLinkAction>
|
|||
.asBuilder()
|
||||
.setRepoId("wrong-repoid")
|
||||
.build());
|
||||
DomainResource superordinateDomain = persistActiveDomain("example1.test");
|
||||
DomainBase superordinateDomain = persistActiveDomain("example1.test");
|
||||
ForeignKeyDomainIndex.create(superordinateDomain, END_OF_TIME);
|
||||
pushToGcs(DEPOSIT_1_HOST);
|
||||
// set transaction time to slightly after resource save
|
||||
|
@ -146,7 +146,7 @@ public class RdeHostLinkActionTest extends MapreduceTestCase<RdeHostLinkAction>
|
|||
.setRepoId("Hns1_example1_test-TEST")
|
||||
.build());
|
||||
persistResource(
|
||||
newDomainResource("example1.test")
|
||||
newDomainBase("example1.test")
|
||||
.asBuilder()
|
||||
.setStatusValues(ImmutableSet.of(PENDING_DELETE))
|
||||
.build());
|
||||
|
|
|
@ -41,7 +41,7 @@ import google.registry.model.EppResource.ForeignKeyedEppResource;
|
|||
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.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.EppResourceIndex;
|
||||
|
@ -174,10 +174,10 @@ public class RdeImportUtilsTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testImportNewDomain() {
|
||||
final DomainResource newDomain = buildNewDomain();
|
||||
final DomainBase newDomain = buildNewDomain();
|
||||
importResourceInTransaction(newDomain);
|
||||
|
||||
DomainResource saved = getDomain("Dexample1-TEST");
|
||||
DomainBase saved = getDomain("Dexample1-TEST");
|
||||
assertThat(saved.getFullyQualifiedDomainName())
|
||||
.isEqualTo(newDomain.getFullyQualifiedDomainName());
|
||||
assertThat(saved.getStatusValues()).isEqualTo(newDomain.getStatusValues());
|
||||
|
@ -192,15 +192,15 @@ public class RdeImportUtilsTest extends ShardableTestCase {
|
|||
|
||||
@Test
|
||||
public void testImportExistingDomain() {
|
||||
DomainResource newDomain = buildNewDomain();
|
||||
DomainBase newDomain = buildNewDomain();
|
||||
persistResource(newDomain);
|
||||
final DomainResource updatedDomain =
|
||||
final DomainBase updatedDomain =
|
||||
newDomain
|
||||
.asBuilder()
|
||||
.setFullyQualifiedDomainName("1" + newDomain.getFullyQualifiedDomainName())
|
||||
.build();
|
||||
assertThrows(ResourceExistsException.class, () -> importResourceInTransaction(updatedDomain));
|
||||
DomainResource saved = getDomain("Dexample1-TEST");
|
||||
DomainBase saved = getDomain("Dexample1-TEST");
|
||||
assertThat(saved.getFullyQualifiedDomainName())
|
||||
.isEqualTo(newDomain.getFullyQualifiedDomainName());
|
||||
assertThat(saved.getStatusValues()).isEqualTo(newDomain.getStatusValues());
|
||||
|
@ -235,10 +235,10 @@ public class RdeImportUtilsTest extends ShardableTestCase {
|
|||
.build();
|
||||
}
|
||||
|
||||
private DomainResource buildNewDomain() {
|
||||
private DomainBase buildNewDomain() {
|
||||
ContactResource registrant = persistActiveContact("jd1234");
|
||||
ContactResource admin = persistActiveContact("sh8013");
|
||||
return new DomainResource.Builder()
|
||||
return new DomainBase.Builder()
|
||||
.setFullyQualifiedDomainName("example1.example")
|
||||
.setRepoId("Dexample1-TEST")
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.OK))
|
||||
|
@ -317,8 +317,8 @@ public class RdeImportUtilsTest extends ShardableTestCase {
|
|||
}
|
||||
|
||||
/** Gets the domain with the specified ROID */
|
||||
private static DomainResource getDomain(String repoId) {
|
||||
final Key<DomainResource> key = Key.create(DomainResource.class, repoId);
|
||||
private static DomainBase getDomain(String repoId) {
|
||||
final Key<DomainBase> key = Key.create(DomainBase.class, repoId);
|
||||
return ofy().transact(() -> ofy().load().key(key).now());
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ 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.DesignatedContact;
|
||||
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;
|
||||
|
@ -68,9 +68,9 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.JUnit4;
|
||||
|
||||
/** Tests for {@link XjcToDomainResourceConverter} */
|
||||
/** Tests for {@link XjcToDomainBaseConverter} */
|
||||
@RunWith(JUnit4.class)
|
||||
public class XjcToDomainResourceConverterTest {
|
||||
public class XjcToDomainBaseConverterTest {
|
||||
|
||||
//List of packages to initialize JAXBContext
|
||||
private static final String JAXB_CONTEXT_PACKAGES = Joiner.on(":").join(asList(
|
||||
|
@ -102,7 +102,7 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResource() {
|
||||
public void testConvertDomainBase() {
|
||||
final ContactResource jd1234 = persistActiveContact("jd1234");
|
||||
final ContactResource sh8013 = persistActiveContact("sh8013");
|
||||
ImmutableSet<DesignatedContact> expectedContacts =
|
||||
|
@ -110,10 +110,10 @@ public class XjcToDomainResourceConverterTest {
|
|||
DesignatedContact.create(DesignatedContact.Type.ADMIN, Key.create(sh8013)),
|
||||
DesignatedContact.create(DesignatedContact.Type.TECH, Key.create(sh8013)));
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getFullyQualifiedDomainName()).isEqualTo("example1.example");
|
||||
assertThat(domain.getRepoId()).isEqualTo("Dexample1-TEST");
|
||||
// A DomainResource has status INACTIVE if there are no nameservers.
|
||||
// A DomainBase has status INACTIVE if there are no nameservers.
|
||||
assertThat(domain.getStatusValues()).isEqualTo(ImmutableSet.of(StatusValue.INACTIVE));
|
||||
assertThat(domain.getRegistrant().getName()).isEqualTo(jd1234.getRepoId());
|
||||
assertThat(domain.getContacts()).isEqualTo(expectedContacts);
|
||||
|
@ -133,20 +133,20 @@ public class XjcToDomainResourceConverterTest {
|
|||
|
||||
/** Verifies that uppercase domain names are converted to lowercase */
|
||||
@Test
|
||||
public void testConvertDomainResourceUpperCase() {
|
||||
public void testConvertDomainBaseUpperCase() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_ucase.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getFullyQualifiedDomainName()).isEqualTo("example1.example");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceAddPeriod() {
|
||||
public void testConvertDomainBaseAddPeriod() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_addPeriod.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getGracePeriods()).hasSize(1);
|
||||
GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
|
||||
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.ADD);
|
||||
|
@ -155,11 +155,11 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceAutoRenewPeriod() {
|
||||
public void testConvertDomainBaseAutoRenewPeriod() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_autoRenewPeriod.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getGracePeriods()).hasSize(1);
|
||||
GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
|
||||
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.AUTO_RENEW);
|
||||
|
@ -168,11 +168,11 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceRedemptionPeriod() {
|
||||
public void testConvertDomainBaseRedemptionPeriod() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_redemptionPeriod.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getGracePeriods()).hasSize(1);
|
||||
GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
|
||||
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.REDEMPTION);
|
||||
|
@ -181,11 +181,11 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceRenewPeriod() {
|
||||
public void testConvertDomainBaseRenewPeriod() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_renewPeriod.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getGracePeriods()).hasSize(1);
|
||||
GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
|
||||
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.RENEW);
|
||||
|
@ -194,11 +194,11 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourcePendingDeletePeriod() {
|
||||
public void testConvertDomainBasePendingDeletePeriod() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_pendingDeletePeriod.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getGracePeriods()).hasSize(1);
|
||||
GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
|
||||
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.PENDING_DELETE);
|
||||
|
@ -207,7 +207,7 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourcePendingRestorePeriodUnsupported() {
|
||||
public void testConvertDomainBasePendingRestorePeriodUnsupported() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_pendingRestorePeriod.xml");
|
||||
|
@ -219,11 +219,11 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceTransferPeriod() {
|
||||
public void testConvertDomainBaseTransferPeriod() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_transferPeriod.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getGracePeriods()).hasSize(1);
|
||||
GracePeriod gracePeriod = domain.getGracePeriods().asList().get(0);
|
||||
assertThat(gracePeriod.getType()).isEqualTo(GracePeriodStatus.TRANSFER);
|
||||
|
@ -241,27 +241,27 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceEppUpdateRegistrar() {
|
||||
public void testConvertDomainBaseEppUpdateRegistrar() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_up_rr.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getLastEppUpdateClientId()).isEqualTo("RegistrarX");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceWithHostObjs() {
|
||||
public void testConvertDomainBaseWithHostObjs() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
HostResource host1 = persistActiveHost("ns1.example.net");
|
||||
HostResource host2 = persistActiveHost("ns2.example.net");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_host_objs.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
assertThat(domain.getNameservers()).containsExactly(Key.create(host1), Key.create(host2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceWithHostAttrs() {
|
||||
public void testConvertDomainBaseWithHostAttrs() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
persistActiveHost("ns1.example.net");
|
||||
|
@ -273,7 +273,7 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceHostNotFound() {
|
||||
public void testConvertDomainBaseHostNotFound() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
persistActiveHost("ns1.example.net");
|
||||
|
@ -286,7 +286,7 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceRegistrantNotFound() {
|
||||
public void testConvertDomainBaseRegistrantNotFound() {
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
|
||||
IllegalStateException thrown =
|
||||
|
@ -295,7 +295,7 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceRegistrantMissing() {
|
||||
public void testConvertDomainBaseRegistrantMissing() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_registrant_missing.xml");
|
||||
|
@ -307,7 +307,7 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceAdminNotFound() {
|
||||
public void testConvertDomainBaseAdminNotFound() {
|
||||
persistActiveContact("jd1234");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
|
||||
IllegalStateException thrown =
|
||||
|
@ -316,24 +316,24 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceSecDnsData() {
|
||||
public void testConvertDomainBaseSecDnsData() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_secdns.xml");
|
||||
DomainResource domain = convertDomainInTransaction(xjcDomain);
|
||||
DomainBase domain = convertDomainInTransaction(xjcDomain);
|
||||
byte[] digest =
|
||||
base16().decode("5FA1FA1C2F70AA483FE178B765D82B272072B4E4167902C5B7F97D46C8899F44");
|
||||
assertThat(domain.getDsData()).containsExactly(DelegationSignerData.create(4609, 8, 2, digest));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceHistoryEntry() throws Exception {
|
||||
public void testConvertDomainBaseHistoryEntry() throws Exception {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
|
||||
// First import in a transaction, then verify in another transaction.
|
||||
// Ancestor queries don't work within the same transaction.
|
||||
DomainResource domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
List<HistoryEntry> historyEntries = getHistoryEntries(domain);
|
||||
assertThat(historyEntries).hasSize(1);
|
||||
HistoryEntry entry = historyEntries.get(0);
|
||||
|
@ -352,13 +352,13 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceAutoRenewBillingEvent() {
|
||||
public void testConvertDomainBaseAutoRenewBillingEvent() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
|
||||
// First import in a transaction, then verify in another transaction.
|
||||
// Ancestor queries don't work within the same transaction.
|
||||
DomainResource domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
BillingEvent.Recurring autoRenewEvent =
|
||||
ofy().load().key(domain.getAutorenewBillingEvent()).now();
|
||||
assertThat(autoRenewEvent.getReason()).isEqualTo(Reason.RENEW);
|
||||
|
@ -370,13 +370,13 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourceAutoRenewPollMessage() {
|
||||
public void testConvertDomainBaseAutoRenewPollMessage() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment.xml");
|
||||
// First import in a transaction, then verify in another transaction.
|
||||
// Ancestor queries don't work within the same transaction.
|
||||
DomainResource domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
PollMessage pollMessage = ofy().load().key(domain.getAutorenewPollMessage()).now();
|
||||
assertThat(pollMessage).isInstanceOf(PollMessage.Autorenew.class);
|
||||
assertThat(((PollMessage.Autorenew) pollMessage).getTargetId()).isEqualTo(xjcDomain.getRoid());
|
||||
|
@ -386,11 +386,11 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourcePendingTransfer() {
|
||||
public void testConvertDomainBasePendingTransfer() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain = loadDomainFromRdeXml("domain_fragment_pending_transfer.xml");
|
||||
DomainResource domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
assertThat(domain.getTransferData()).isNotNull();
|
||||
assertThat(domain.getTransferData().getTransferStatus()).isEqualTo(TransferStatus.PENDING);
|
||||
assertThat(domain.getTransferData().getGainingClientId()).isEqualTo("RegistrarY");
|
||||
|
@ -402,18 +402,18 @@ public class XjcToDomainResourceConverterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConvertDomainResourcePendingTransferRegistrationCap() {
|
||||
public void testConvertDomainBasePendingTransferRegistrationCap() {
|
||||
persistActiveContact("jd1234");
|
||||
persistActiveContact("sh8013");
|
||||
final XjcRdeDomain xjcDomain =
|
||||
loadDomainFromRdeXml("domain_fragment_pending_transfer_registration_cap.xml");
|
||||
DomainResource domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
DomainBase domain = persistResource(convertDomainInTransaction(xjcDomain));
|
||||
assertThat(domain.getTransferData()).isNotNull();
|
||||
// This test will be imcomplete until b/36405140 is fixed to store exDate on TransferData, since
|
||||
// without that there's no way to actually test the capping of the projected registration here.
|
||||
}
|
||||
|
||||
private DomainResource convertDomainInTransaction(final XjcRdeDomain xjcDomain) {
|
||||
private DomainBase convertDomainInTransaction(final XjcRdeDomain xjcDomain) {
|
||||
return ofy()
|
||||
.transact(
|
||||
() -> {
|
||||
|
@ -423,7 +423,7 @@ public class XjcToDomainResourceConverterTest {
|
|||
PollMessage.Autorenew autorenewPollMessage =
|
||||
createAutoRenewPollMessageForDomainImport(xjcDomain, historyEntry);
|
||||
ofy().save().entities(historyEntry, autorenewBillingEvent, autorenewPollMessage);
|
||||
return XjcToDomainResourceConverter.convertDomain(
|
||||
return XjcToDomainBaseConverter.convertDomain(
|
||||
xjcDomain, autorenewBillingEvent, autorenewPollMessage, stringGenerator);
|
||||
});
|
||||
}
|
|
@ -32,7 +32,6 @@ JOIN
|
|||
ON
|
||||
currentSponsorClientId = registrar_table.__key__.name
|
||||
WHERE
|
||||
domain_table._d = 'DomainResource'
|
||||
AND (registrar_table.type = 'REAL' OR registrar_table.type = 'INTERNAL')
|
||||
registrar_table.type = 'REAL' OR registrar_table.type = 'INTERNAL'
|
||||
GROUP BY tld, registrarName
|
||||
ORDER BY tld, registrarName
|
||||
|
|
|
@ -44,8 +44,7 @@ JOIN (
|
|||
FROM
|
||||
`domain-registry-alpha.latest_datastore_export.DomainBase`,
|
||||
UNNEST(nsHosts) AS hosts
|
||||
WHERE _d = 'DomainResource'
|
||||
AND creationTime <= TIMESTAMP("2017-09-30 23:59:59.999")
|
||||
WHERE creationTime <= TIMESTAMP("2017-09-30 23:59:59.999")
|
||||
AND deletionTime > TIMESTAMP("2017-09-30 23:59:59.999") ) AS domain_table
|
||||
ON
|
||||
host_table.__key__.name = domain_table.referencedHostName
|
||||
|
|
|
@ -20,7 +20,7 @@ import static google.registry.model.domain.DesignatedContact.Type.TECH;
|
|||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.newContactResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainBase;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistPremiumList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -124,7 +124,7 @@ public enum Fixture {
|
|||
.build());
|
||||
|
||||
persistResource(
|
||||
newDomainResource("love.xn--q9jyb4c", justine).asBuilder()
|
||||
newDomainBase("love.xn--q9jyb4c", justine).asBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(ADMIN, Key.create(robert)),
|
||||
DesignatedContact.create(BILLING, Key.create(google)),
|
||||
|
@ -135,7 +135,7 @@ public enum Fixture {
|
|||
.build());
|
||||
|
||||
persistResource(
|
||||
newDomainResource("moogle.example", justine).asBuilder()
|
||||
newDomainBase("moogle.example", justine).asBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(ADMIN, Key.create(robert)),
|
||||
DesignatedContact.create(BILLING, Key.create(google)),
|
||||
|
|
|
@ -17,14 +17,13 @@ package google.registry.testing;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.truth.FailureMetadata;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.eppcommon.AuthInfo;
|
||||
import google.registry.testing.TruthChainer.And;
|
||||
import java.util.Set;
|
||||
|
||||
/** Truth subject for asserting things about {@link DomainResource} instances. */
|
||||
/** Truth subject for asserting things about {@link DomainBase} instances. */
|
||||
public abstract class AbstractDomainBaseSubject
|
||||
<T extends DomainBase, S extends AbstractDomainBaseSubject<T, S>>
|
||||
extends AbstractEppResourceSubject<T, S> {
|
||||
|
|
|
@ -67,7 +67,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.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -125,27 +125,27 @@ public class DatastoreHelper {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static DomainResource newDomainResource(String domainName) {
|
||||
public static DomainBase newDomainBase(String domainName) {
|
||||
String repoId = generateNewDomainRoid(getTldFromDomainName(domainName));
|
||||
return newDomainResource(domainName, repoId, persistActiveContact("contact1234"));
|
||||
return newDomainBase(domainName, repoId, persistActiveContact("contact1234"));
|
||||
}
|
||||
|
||||
public static DomainResource newDomainResource(String domainName, ContactResource contact) {
|
||||
return newDomainResource(
|
||||
public static DomainBase newDomainBase(String domainName, ContactResource contact) {
|
||||
return newDomainBase(
|
||||
domainName, generateNewDomainRoid(getTldFromDomainName(domainName)), contact);
|
||||
}
|
||||
|
||||
public static DomainResource newDomainResource(String domainName, HostResource host) {
|
||||
return newDomainResource(domainName)
|
||||
public static DomainBase newDomainBase(String domainName, HostResource host) {
|
||||
return newDomainBase(domainName)
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host)))
|
||||
.build();
|
||||
}
|
||||
|
||||
public static DomainResource newDomainResource(
|
||||
public static DomainBase newDomainBase(
|
||||
String domainName, String repoId, ContactResource contact) {
|
||||
Key<ContactResource> contactKey = Key.create(contact);
|
||||
return new DomainResource.Builder()
|
||||
return new DomainBase.Builder()
|
||||
.setRepoId(repoId)
|
||||
.setFullyQualifiedDomainName(domainName)
|
||||
.setCreationClientId("TheRegistrar")
|
||||
|
@ -233,7 +233,7 @@ public class DatastoreHelper {
|
|||
}
|
||||
|
||||
public static HostResource persistActiveSubordinateHost(
|
||||
String hostName, DomainResource superordinateDomain) {
|
||||
String hostName, DomainBase superordinateDomain) {
|
||||
checkNotNull(superordinateDomain);
|
||||
return persistResource(
|
||||
newHostResource(hostName)
|
||||
|
@ -250,19 +250,19 @@ public class DatastoreHelper {
|
|||
newHostResource(hostName).asBuilder().setDeletionTime(deletionTime).build());
|
||||
}
|
||||
|
||||
public static DomainResource persistActiveDomain(String domainName) {
|
||||
return persistResource(newDomainResource(domainName));
|
||||
public static DomainBase persistActiveDomain(String domainName) {
|
||||
return persistResource(newDomainBase(domainName));
|
||||
}
|
||||
|
||||
public static DomainResource persistActiveDomain(String domainName, DateTime creationTime) {
|
||||
public static DomainBase persistActiveDomain(String domainName, DateTime creationTime) {
|
||||
return persistResource(
|
||||
newDomainResource(domainName).asBuilder().setCreationTimeForTest(creationTime).build());
|
||||
newDomainBase(domainName).asBuilder().setCreationTimeForTest(creationTime).build());
|
||||
}
|
||||
|
||||
public static DomainResource persistActiveDomain(
|
||||
public static DomainBase persistActiveDomain(
|
||||
String domainName, DateTime creationTime, DateTime expirationTime) {
|
||||
return persistResource(
|
||||
newDomainResource(domainName)
|
||||
newDomainBase(domainName)
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(creationTime)
|
||||
.setRegistrationExpirationTime(expirationTime)
|
||||
|
@ -270,26 +270,26 @@ public class DatastoreHelper {
|
|||
}
|
||||
|
||||
/** Persists a domain resource with the given domain name deleted at the specified time. */
|
||||
public static DomainResource persistDeletedDomain(String domainName, DateTime deletionTime) {
|
||||
return persistDomainAsDeleted(newDomainResource(domainName), deletionTime);
|
||||
public static DomainBase persistDeletedDomain(String domainName, DateTime deletionTime) {
|
||||
return persistDomainAsDeleted(newDomainBase(domainName), deletionTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a persisted domain that is the passed-in domain modified to be deleted at the specified
|
||||
* time.
|
||||
*/
|
||||
public static DomainResource persistDomainAsDeleted(
|
||||
DomainResource domain, DateTime deletionTime) {
|
||||
public static DomainBase persistDomainAsDeleted(
|
||||
DomainBase domain, DateTime deletionTime) {
|
||||
return persistResource(domain.asBuilder().setDeletionTime(deletionTime).build());
|
||||
}
|
||||
|
||||
/** Persists a domain and enqueues a LORDN task of the appropriate type for it. */
|
||||
public static DomainResource persistDomainAndEnqueueLordn(final DomainResource domain) {
|
||||
final DomainResource persistedDomain = persistResource(domain);
|
||||
// Calls {@link LordnTaskUtils#enqueueDomainResourceTask} wrapped in an ofy transaction so that
|
||||
public static DomainBase persistDomainAndEnqueueLordn(final DomainBase domain) {
|
||||
final DomainBase persistedDomain = persistResource(domain);
|
||||
// Calls {@link LordnTaskUtils#enqueueDomainBaseTask} wrapped in an ofy transaction so that
|
||||
// the
|
||||
// transaction time is set correctly.
|
||||
ofy().transactNew(() -> LordnTaskUtils.enqueueDomainResourceTask(persistedDomain));
|
||||
ofy().transactNew(() -> LordnTaskUtils.enqueueDomainBaseTask(persistedDomain));
|
||||
return persistedDomain;
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ public class DatastoreHelper {
|
|||
}
|
||||
|
||||
public static BillingEvent.OneTime createBillingEventForTransfer(
|
||||
DomainResource domain,
|
||||
DomainBase domain,
|
||||
HistoryEntry historyEntry,
|
||||
DateTime costLookupTime,
|
||||
DateTime eventTime) {
|
||||
|
@ -473,7 +473,7 @@ public class DatastoreHelper {
|
|||
.build());
|
||||
}
|
||||
|
||||
public static DomainResource persistDomainWithDependentResources(
|
||||
public static DomainBase persistDomainWithDependentResources(
|
||||
String label,
|
||||
String tld,
|
||||
ContactResource contact,
|
||||
|
@ -481,8 +481,8 @@ public class DatastoreHelper {
|
|||
DateTime creationTime,
|
||||
DateTime expirationTime) {
|
||||
String domainName = String.format("%s.%s", label, tld);
|
||||
DomainResource domain =
|
||||
new DomainResource.Builder()
|
||||
DomainBase domain =
|
||||
new DomainBase.Builder()
|
||||
.setRepoId(generateNewDomainRoid(tld))
|
||||
.setFullyQualifiedDomainName(domainName)
|
||||
.setPersistedCurrentSponsorClientId("TheRegistrar")
|
||||
|
@ -533,8 +533,8 @@ public class DatastoreHelper {
|
|||
.build());
|
||||
}
|
||||
|
||||
public static DomainResource persistDomainWithPendingTransfer(
|
||||
DomainResource domain,
|
||||
public static DomainBase persistDomainWithPendingTransfer(
|
||||
DomainBase domain,
|
||||
DateTime requestTime,
|
||||
DateTime expirationTime,
|
||||
DateTime extendedRegistrationExpirationTime,
|
||||
|
@ -978,7 +978,7 @@ public class DatastoreHelper {
|
|||
} else if (resource instanceof HostResource) {
|
||||
return resource.getRepoId() != null
|
||||
? HistoryEntry.Type.HOST_CREATE : HistoryEntry.Type.HOST_UPDATE;
|
||||
} else if (resource instanceof DomainResource) {
|
||||
} else if (resource instanceof DomainBase) {
|
||||
return resource.getRepoId() != null
|
||||
? HistoryEntry.Type.DOMAIN_CREATE : HistoryEntry.Type.DOMAIN_UPDATE;
|
||||
} else {
|
||||
|
|
|
@ -19,16 +19,16 @@ import static com.google.common.truth.Truth.assertAbout;
|
|||
|
||||
import com.google.common.truth.FailureMetadata;
|
||||
import com.google.common.truth.SimpleSubjectBuilder;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.testing.TruthChainer.And;
|
||||
import java.util.Objects;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** Truth subject for asserting things about {@link DomainResource} instances. */
|
||||
public final class DomainResourceSubject
|
||||
extends AbstractDomainBaseSubject<DomainResource, DomainResourceSubject> {
|
||||
/** Truth subject for asserting things about {@link DomainBase} instances. */
|
||||
public final class DomainBaseSubject
|
||||
extends AbstractDomainBaseSubject<DomainBase, DomainBaseSubject> {
|
||||
|
||||
public And<DomainResourceSubject> hasRegistrationExpirationTime(DateTime expiration) {
|
||||
public And<DomainBaseSubject> hasRegistrationExpirationTime(DateTime expiration) {
|
||||
if (!Objects.equals(actual().getRegistrationExpirationTime(), expiration)) {
|
||||
failWithBadResults(
|
||||
"has registrationExpirationTime",
|
||||
|
@ -38,43 +38,43 @@ public final class DomainResourceSubject
|
|||
return andChainer();
|
||||
}
|
||||
|
||||
public And<DomainResourceSubject> hasLastTransferTime(DateTime lastTransferTime) {
|
||||
public And<DomainBaseSubject> hasLastTransferTime(DateTime lastTransferTime) {
|
||||
return hasValue(
|
||||
lastTransferTime,
|
||||
actual().getLastTransferTime(),
|
||||
"has lastTransferTime");
|
||||
}
|
||||
|
||||
public And<DomainResourceSubject> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
|
||||
public And<DomainBaseSubject> hasLastTransferTimeNotEqualTo(DateTime lastTransferTime) {
|
||||
return doesNotHaveValue(
|
||||
lastTransferTime,
|
||||
actual().getLastTransferTime(),
|
||||
"lastTransferTime");
|
||||
}
|
||||
|
||||
public And<DomainResourceSubject> hasDeletePollMessage() {
|
||||
public And<DomainBaseSubject> hasDeletePollMessage() {
|
||||
if (actual().getDeletePollMessage() == null) {
|
||||
fail("has a delete poll message");
|
||||
}
|
||||
return andChainer();
|
||||
}
|
||||
|
||||
public And<DomainResourceSubject> hasNoDeletePollMessage() {
|
||||
public And<DomainBaseSubject> hasNoDeletePollMessage() {
|
||||
if (actual().getDeletePollMessage() != null) {
|
||||
fail("has no delete poll message");
|
||||
}
|
||||
return andChainer();
|
||||
}
|
||||
|
||||
public And<DomainResourceSubject> hasSmdId(String smdId) {
|
||||
public And<DomainBaseSubject> hasSmdId(String smdId) {
|
||||
return hasValue(smdId, actual().getSmdId(), "has smdId");
|
||||
}
|
||||
|
||||
public DomainResourceSubject(FailureMetadata failureMetadata, DomainResource subject) {
|
||||
public DomainBaseSubject(FailureMetadata failureMetadata, DomainBase subject) {
|
||||
super(failureMetadata, checkNotNull(subject));
|
||||
}
|
||||
|
||||
public static SimpleSubjectBuilder<DomainResourceSubject, DomainResource> assertAboutDomains() {
|
||||
return assertAbout(DomainResourceSubject::new);
|
||||
public static SimpleSubjectBuilder<DomainBaseSubject, DomainBase> assertAboutDomains() {
|
||||
return assertAbout(DomainBaseSubject::new);
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ import google.registry.model.contact.ContactPhoneNumber;
|
|||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
|
@ -332,7 +332,7 @@ public final class FullFieldsTestEntityHelper {
|
|||
return contactResource;
|
||||
}
|
||||
|
||||
public static DomainResource makeDomainResource(
|
||||
public static DomainBase makeDomainBase(
|
||||
String domain,
|
||||
@Nullable ContactResource registrant,
|
||||
@Nullable ContactResource admin,
|
||||
|
@ -340,7 +340,7 @@ public final class FullFieldsTestEntityHelper {
|
|||
@Nullable HostResource ns1,
|
||||
@Nullable HostResource ns2,
|
||||
Registrar registrar) {
|
||||
DomainResource.Builder builder = new DomainResource.Builder()
|
||||
DomainBase.Builder builder = new DomainBase.Builder()
|
||||
.setFullyQualifiedDomainName(Idn.toASCII(domain))
|
||||
.setRepoId(generateNewDomainRoid(getTldFromDomainName(Idn.toASCII(domain))))
|
||||
.setLastEppUpdateTime(DateTime.parse("2009-05-29T20:13:00Z"))
|
||||
|
|
|
@ -20,7 +20,7 @@ import static com.google.common.truth.Truth.assertAbout;
|
|||
import com.google.common.truth.FailureMetadata;
|
||||
import com.google.common.truth.SimpleSubjectBuilder;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.testing.TruthChainer.And;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -58,7 +58,7 @@ public final class HostResourceSubject
|
|||
"has lastSuperordinateChange");
|
||||
}
|
||||
|
||||
public And<HostResourceSubject> hasSuperordinateDomain(Key<DomainResource> superordinateDomain) {
|
||||
public And<HostResourceSubject> hasSuperordinateDomain(Key<DomainBase> superordinateDomain) {
|
||||
return hasValue(
|
||||
superordinateDomain,
|
||||
actual().getSuperordinateDomain(),
|
||||
|
|
|
@ -24,7 +24,7 @@ import static google.registry.testing.JUnitBackports.assertThrows;
|
|||
import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.registrar.Registrar.Type;
|
||||
|
@ -60,8 +60,8 @@ public class LordnTaskUtilsTest {
|
|||
inject.setStaticField(Ofy.class, "clock", clock);
|
||||
}
|
||||
|
||||
private DomainResource.Builder newDomainBuilder() {
|
||||
return new DomainResource.Builder()
|
||||
private DomainBase.Builder newDomainBuilder() {
|
||||
return new DomainBase.Builder()
|
||||
.setFullyQualifiedDomainName("fleece.example")
|
||||
.setRegistrant(Key.create(persistActiveContact("jd1234")))
|
||||
.setSmdId("smdzzzz")
|
||||
|
@ -69,7 +69,7 @@ public class LordnTaskUtilsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_enqueueDomainResourceTask_sunrise() {
|
||||
public void test_enqueueDomainBaseTask_sunrise() {
|
||||
persistDomainAndEnqueueLordn(newDomainBuilder().setRepoId("A-EXAMPLE").build());
|
||||
String expectedPayload =
|
||||
"A-EXAMPLE,fleece.example,smdzzzz,1,2010-05-01T10:11:12.000Z";
|
||||
|
@ -78,8 +78,8 @@ public class LordnTaskUtilsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_enqueueDomainResourceTask_claims() {
|
||||
DomainResource domain =
|
||||
public void test_enqueueDomainBaseTask_claims() {
|
||||
DomainBase domain =
|
||||
newDomainBuilder()
|
||||
.setRepoId("11-EXAMPLE")
|
||||
.setLaunchNotice(
|
||||
|
@ -113,8 +113,8 @@ public class LordnTaskUtilsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_enqueueDomainResourceTask_throwsExceptionOnInvalidRegistrar() {
|
||||
DomainResource domain =
|
||||
public void test_enqueueDomainBaseTask_throwsExceptionOnInvalidRegistrar() {
|
||||
DomainBase domain =
|
||||
newDomainBuilder()
|
||||
.setRepoId("9000-EXAMPLE")
|
||||
.setCreationClientId("nonexistentRegistrar")
|
||||
|
@ -127,9 +127,9 @@ public class LordnTaskUtilsTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_enqueueDomainResourceTask_throwsNpeOnNullDomain() {
|
||||
public void test_enqueueDomainBaseTask_throwsNpeOnNullDomain() {
|
||||
assertThrows(
|
||||
NullPointerException.class,
|
||||
() -> ofy().transactNew(() -> LordnTaskUtils.enqueueDomainResourceTask(null)));
|
||||
() -> ofy().transactNew(() -> LordnTaskUtils.enqueueDomainBaseTask(null)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
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.persistDomainAndEnqueueLordn;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -49,7 +49,7 @@ import com.google.appengine.api.urlfetch.URLFetchService;
|
|||
import com.google.apphosting.api.DeadlineExceededException;
|
||||
import com.google.common.base.VerifyException;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.registry.Registry;
|
||||
|
@ -271,7 +271,7 @@ public class NordnUploadActionTest {
|
|||
}
|
||||
|
||||
private void persistClaimsModeDomain() {
|
||||
DomainResource domain = newDomainResource("claims-landrush1.tld");
|
||||
DomainBase domain = newDomainBase("claims-landrush1.tld");
|
||||
persistDomainAndEnqueueLordn(
|
||||
domain
|
||||
.asBuilder()
|
||||
|
@ -283,7 +283,7 @@ public class NordnUploadActionTest {
|
|||
|
||||
private void persistSunriseModeDomain() {
|
||||
action.phase = "sunrise";
|
||||
DomainResource domain = newDomainResource("sunrise1.tld");
|
||||
DomainBase domain = newDomainBase("sunrise1.tld");
|
||||
persistDomainAndEnqueueLordn(domain.asBuilder().setSmdId("my-smdid").build());
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
import google.registry.flows.EppTestCase;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.reporting.HistoryEntry.Type;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.util.Clock;
|
||||
|
@ -139,9 +139,9 @@ public class EppLifecycleToolsTest extends EppTestCase {
|
|||
|
||||
// Assert about billing events.
|
||||
DateTime createTime = DateTime.parse("2000-06-01T00:02:00Z");
|
||||
DomainResource domain =
|
||||
DomainBase domain =
|
||||
loadByForeignKey(
|
||||
DomainResource.class, "example.tld", DateTime.parse("2003-06-02T00:02:00Z"))
|
||||
DomainBase.class, "example.tld", DateTime.parse("2003-06-02T00:02:00Z"))
|
||||
.get();
|
||||
BillingEvent.OneTime renewBillingEvent =
|
||||
new BillingEvent.OneTime.Builder()
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.tools;
|
|||
import static com.google.common.io.BaseEncoding.base16;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
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.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
|
@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import com.googlecode.objectify.Key;
|
||||
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;
|
||||
|
@ -70,7 +70,7 @@ public class GenerateDnsReportCommandTest extends CommandTestCase<GenerateDnsRep
|
|||
private HostResource nameserver2;
|
||||
private HostResource nameserver3;
|
||||
private HostResource nameserver4;
|
||||
private DomainResource domain1;
|
||||
private DomainBase domain1;
|
||||
|
||||
private static final ImmutableMap<String, ?> DOMAIN1_OUTPUT = ImmutableMap.of(
|
||||
"domain", "example.xn--q9jyb4c",
|
||||
|
@ -130,13 +130,13 @@ public class GenerateDnsReportCommandTest extends CommandTestCase<GenerateDnsRep
|
|||
.build());
|
||||
nameserver3 = persistActiveHost("ns1.google.com");
|
||||
nameserver4 = persistActiveHost("ns2.google.com");
|
||||
domain1 = persistResource(newDomainResource("example.xn--q9jyb4c").asBuilder()
|
||||
domain1 = persistResource(newDomainBase("example.xn--q9jyb4c").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(nameserver1), Key.create(nameserver2)))
|
||||
.setDsData(ImmutableSet.of(
|
||||
DelegationSignerData.create(12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC")),
|
||||
DelegationSignerData.create(56789, 2, 4, base16().decode("69FD46E6C4A45C55D4AC"))))
|
||||
.build());
|
||||
persistResource(newDomainResource("foobar.xn--q9jyb4c").asBuilder()
|
||||
persistResource(newDomainBase("foobar.xn--q9jyb4c").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(nameserver3), Key.create(nameserver4)))
|
||||
.build());
|
||||
// Persist a domain in a different tld that should be ignored.
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.tools;
|
||||
|
||||
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.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistDeletedDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -69,7 +69,7 @@ public class GetDomainCommandTest extends CommandTestCase<GetDomainCommand> {
|
|||
|
||||
@Test
|
||||
public void testSuccess_domainDeletedInFuture() throws Exception {
|
||||
persistResource(newDomainResource("example.tld").asBuilder()
|
||||
persistResource(newDomainBase("example.tld").asBuilder()
|
||||
.setDeletionTime(now.plusDays(1)).build());
|
||||
runCommand("example.tld", "--read_timestamp=" + now.plusMonths(1));
|
||||
assertInStdout("Domain 'example.tld' does not exist or is deleted");
|
||||
|
|
|
@ -19,7 +19,7 @@ import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
|||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHistoryEntry;
|
||||
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.FakeClock;
|
||||
|
@ -32,7 +32,7 @@ public class GetHistoryEntriesCommandTest extends CommandTestCase<GetHistoryEntr
|
|||
|
||||
private final FakeClock clock = new FakeClock(DateTime.parse("2000-01-01T00:00:00Z"));
|
||||
|
||||
private DomainResource domain;
|
||||
private DomainBase domain;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
|
|
|
@ -16,7 +16,7 @@ package google.registry.tools;
|
|||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.eppcommon.StatusValue.SERVER_TRANSFER_PROHIBITED;
|
||||
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.persistNewRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -51,7 +51,7 @@ public class LockDomainCommandTest extends EppToolCommandTestCase<LockDomainComm
|
|||
@Test
|
||||
public void testSuccess_partiallyUpdatesStatuses() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.addStatusValue(SERVER_TRANSFER_PROHIBITED)
|
||||
.build());
|
||||
|
@ -88,7 +88,7 @@ public class LockDomainCommandTest extends EppToolCommandTestCase<LockDomainComm
|
|||
@Test
|
||||
public void testSuccess_alreadyLockedDomain_performsNoAction() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.addStatusValues(REGISTRY_LOCK_STATUSES)
|
||||
.build());
|
||||
|
|
|
@ -16,7 +16,7 @@ package google.registry.tools;
|
|||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
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.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -57,7 +57,7 @@ public class UniformRapidSuspensionCommandTest
|
|||
for (HostResource host : hosts) {
|
||||
hostRefs.add(Key.create(host));
|
||||
}
|
||||
persistResource(newDomainResource("evil.tld").asBuilder()
|
||||
persistResource(newDomainBase("evil.tld").asBuilder()
|
||||
.setNameservers(hostRefs.build())
|
||||
.setDsData(ImmutableSet.of(
|
||||
DelegationSignerData.create(1, 2, 3, new HexBinaryAdapter().unmarshal("dead")),
|
||||
|
@ -112,7 +112,7 @@ public class UniformRapidSuspensionCommandTest
|
|||
@Test
|
||||
public void testCommand_generatesUndoWithLocksToPreserve() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource("evil.tld").asBuilder()
|
||||
newDomainBase("evil.tld").asBuilder()
|
||||
.addStatusValue(StatusValue.SERVER_DELETE_PROHIBITED)
|
||||
.build());
|
||||
runCommandForced("--domain_name=evil.tld");
|
||||
|
|
|
@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
import static google.registry.model.eppcommon.StatusValue.SERVER_DELETE_PROHIBITED;
|
||||
import static google.registry.model.eppcommon.StatusValue.SERVER_TRANSFER_PROHIBITED;
|
||||
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
||||
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.persistNewRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -45,7 +45,7 @@ public class UnlockDomainCommandTest extends EppToolCommandTestCase<UnlockDomain
|
|||
|
||||
private static void persistLockedDomain(String domainName) {
|
||||
persistResource(
|
||||
newDomainResource(domainName)
|
||||
newDomainBase(domainName)
|
||||
.asBuilder()
|
||||
.addStatusValues(
|
||||
ImmutableSet.of(
|
||||
|
@ -63,7 +63,7 @@ public class UnlockDomainCommandTest extends EppToolCommandTestCase<UnlockDomain
|
|||
@Test
|
||||
public void testSuccess_partiallyUpdatesStatuses() throws Exception {
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.addStatusValues(ImmutableSet.of(SERVER_DELETE_PROHIBITED, SERVER_UPDATE_PROHIBITED))
|
||||
.build());
|
||||
|
|
|
@ -24,7 +24,7 @@ import static google.registry.testing.DatastoreHelper.assertBillingEventsEqual;
|
|||
import static google.registry.testing.DatastoreHelper.assertPollMessagesEqual;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.getOnlyHistoryEntryOfType;
|
||||
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.persistDeletedDomain;
|
||||
|
@ -39,7 +39,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.ofy.Ofy;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
|
@ -78,12 +78,12 @@ public class UnrenewDomainCommandTest extends CommandTestCase<UnrenewDomainComma
|
|||
runCommandForced("-p", "2", "foo.tld", "bar.tld");
|
||||
clock.advanceOneMilli();
|
||||
assertThat(
|
||||
loadByForeignKey(DomainResource.class, "foo.tld", clock.nowUtc())
|
||||
loadByForeignKey(DomainBase.class, "foo.tld", clock.nowUtc())
|
||||
.get()
|
||||
.getRegistrationExpirationTime())
|
||||
.isEqualTo(DateTime.parse("2019-12-06T13:55:01.001Z"));
|
||||
assertThat(
|
||||
loadByForeignKey(DomainResource.class, "bar.tld", clock.nowUtc())
|
||||
loadByForeignKey(DomainBase.class, "bar.tld", clock.nowUtc())
|
||||
.get()
|
||||
.getRegistrationExpirationTime())
|
||||
.isEqualTo(DateTime.parse("2018-12-06T13:55:01.002Z"));
|
||||
|
@ -101,7 +101,7 @@ public class UnrenewDomainCommandTest extends CommandTestCase<UnrenewDomainComma
|
|||
runCommandForced("-p", "2", "foo.tld");
|
||||
DateTime unrenewTime = clock.nowUtc();
|
||||
clock.advanceOneMilli();
|
||||
DomainResource domain = loadByForeignKey(DomainResource.class, "foo.tld", clock.nowUtc()).get();
|
||||
DomainBase domain = loadByForeignKey(DomainBase.class, "foo.tld", clock.nowUtc()).get();
|
||||
|
||||
assertAboutHistoryEntries()
|
||||
.that(getOnlyHistoryEntryOfType(domain, SYNTHETIC))
|
||||
|
@ -174,19 +174,19 @@ public class UnrenewDomainCommandTest extends CommandTestCase<UnrenewDomainComma
|
|||
public void test_varietyOfInvalidDomains_displaysErrors() {
|
||||
DateTime now = clock.nowUtc();
|
||||
persistResource(
|
||||
newDomainResource("deleting.tld")
|
||||
newDomainBase("deleting.tld")
|
||||
.asBuilder()
|
||||
.setDeletionTime(now.plusHours(1))
|
||||
.setStatusValues(ImmutableSet.of(PENDING_DELETE))
|
||||
.build());
|
||||
persistDeletedDomain("deleted.tld", now.minusHours(1));
|
||||
persistResource(
|
||||
newDomainResource("transferring.tld")
|
||||
newDomainBase("transferring.tld")
|
||||
.asBuilder()
|
||||
.setStatusValues(ImmutableSet.of(PENDING_TRANSFER))
|
||||
.build());
|
||||
persistResource(
|
||||
newDomainResource("locked.tld")
|
||||
newDomainBase("locked.tld")
|
||||
.asBuilder()
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.SERVER_UPDATE_PROHIBITED))
|
||||
.build());
|
||||
|
|
|
@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
|||
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.DatastoreHelper.newContactResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainBase;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
@ -114,12 +114,12 @@ public class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomain
|
|||
HostResource host1 = persistActiveHost("foo.bar.tld");
|
||||
HostResource host2 = persistActiveHost("baz.bar.tld");
|
||||
persistResource(
|
||||
newDomainResource("example.abc")
|
||||
newDomainBase("example.abc")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host1)))
|
||||
.build());
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(Key.create(host2)))
|
||||
.build());
|
||||
|
@ -174,7 +174,7 @@ public class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomain
|
|||
ImmutableSet<Key<HostResource>> nameservers =
|
||||
ImmutableSet.of(Key.create(host1), Key.create(host2));
|
||||
persistResource(
|
||||
newDomainResource("example.tld").asBuilder().setNameservers(nameservers).build());
|
||||
newDomainBase("example.tld").asBuilder().setNameservers(nameservers).build());
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar", "--nameservers=ns2.zdns.google,ns3.zdns.google", "example.tld");
|
||||
eppVerifier.verifySent("domain_update_set_nameservers.xml");
|
||||
|
@ -192,7 +192,7 @@ public class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomain
|
|||
Key<ContactResource> techResourceKey2 = Key.create(techContact2);
|
||||
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
ImmutableSet.of(
|
||||
|
@ -215,7 +215,7 @@ public class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomain
|
|||
HostResource host = persistActiveHost("ns1.zdns.google");
|
||||
ImmutableSet<Key<HostResource>> nameservers = ImmutableSet.of(Key.create(host));
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setStatusValues(
|
||||
ImmutableSet.of(
|
||||
|
@ -259,7 +259,7 @@ public class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomain
|
|||
HostResource host = persistActiveHost("ns1.zdns.google");
|
||||
ImmutableSet<Key<HostResource>> nameservers = ImmutableSet.of(Key.create(host));
|
||||
persistResource(
|
||||
newDomainResource("example.tld")
|
||||
newDomainBase("example.tld")
|
||||
.asBuilder()
|
||||
.setStatusValues(ImmutableSet.of(SERVER_UPDATE_PROHIBITED))
|
||||
.setNameservers(nameservers)
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.tools.server;
|
|||
import static com.google.appengine.tools.cloudstorage.GcsServiceFactory.createGcsService;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
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;
|
||||
|
@ -72,43 +72,43 @@ public class GenerateZoneFilesActionTest extends MapreduceTestCase<GenerateZoneF
|
|||
// This domain will have glue records, because it has a subordinate host which is its own
|
||||
// nameserver. None of the other domains should have glue records, because their nameservers are
|
||||
// subordinate to different domains.
|
||||
persistResource(newDomainResource("bar.tld").asBuilder()
|
||||
persistResource(newDomainBase("bar.tld").asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.addSubordinateHost("ns.bar.tld")
|
||||
.build());
|
||||
persistResource(newDomainResource("foo.tld").asBuilder()
|
||||
persistResource(newDomainBase("foo.tld").asBuilder()
|
||||
.addSubordinateHost("ns.foo.tld")
|
||||
.build());
|
||||
persistResource(newDomainResource("ns-and-ds.tld").asBuilder()
|
||||
persistResource(newDomainBase("ns-and-ds.tld").asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
persistResource(newDomainResource("ns-only.tld").asBuilder()
|
||||
persistResource(newDomainBase("ns-only.tld").asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.build());
|
||||
persistResource(newDomainResource("ns-only-client-hold.tld").asBuilder()
|
||||
persistResource(newDomainBase("ns-only-client-hold.tld").asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.CLIENT_HOLD))
|
||||
.build());
|
||||
persistResource(newDomainResource("ns-only-pending-delete.tld").asBuilder()
|
||||
persistResource(newDomainBase("ns-only-pending-delete.tld").asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE))
|
||||
.build());
|
||||
persistResource(newDomainResource("ns-only-server-hold.tld").asBuilder()
|
||||
persistResource(newDomainBase("ns-only-server-hold.tld").asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.SERVER_HOLD))
|
||||
.build());
|
||||
// These should be ignored; contacts aren't in DNS, hosts need to be from the same tld and have
|
||||
// IP addresses, and domains need to be from the same TLD and have hosts (even in the case where
|
||||
// domains contain DS data).
|
||||
persistResource(newDomainResource("ds-only.tld").asBuilder()
|
||||
persistResource(newDomainBase("ds-only.tld").asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
.build());
|
||||
persistActiveContact("ignored_contact");
|
||||
persistActiveHost("ignored.host.tld"); // No ips.
|
||||
persistActiveDomain("ignored_domain.tld"); // No hosts or DS data.
|
||||
persistResource(newHostResource("ignored.foo.com").asBuilder().addInetAddresses(ips).build());
|
||||
persistResource(newDomainResource("ignored.com")
|
||||
persistResource(newDomainBase("ignored.com")
|
||||
.asBuilder()
|
||||
.addNameservers(nameservers)
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(1, 2, 3, new byte[] {0, 1, 2})))
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.google.appengine.api.datastore.DatastoreService;
|
|||
import com.google.appengine.api.datastore.DatastoreServiceFactory;
|
||||
import com.google.appengine.api.datastore.Entity;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.mapreduce.MapreduceTestCase;
|
||||
|
@ -56,7 +56,7 @@ public class ResaveAllHistoryEntriesActionTest
|
|||
@Test
|
||||
public void test_mapreduceSuccessfullyResavesEntity() throws Exception {
|
||||
createTld("tld");
|
||||
DomainResource domain = persistActiveDomain("test.tld");
|
||||
DomainBase domain = persistActiveDomain("test.tld");
|
||||
ContactResource contact = persistActiveContact("humanBeing");
|
||||
Entity domainEntry =
|
||||
ofy().save().toEntity(new HistoryEntry.Builder().setParent(domain).build());
|
||||
|
|
|
@ -29,7 +29,7 @@ import google.registry.model.contact.ContactPhoneNumber;
|
|||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
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;
|
||||
|
@ -62,7 +62,7 @@ public class DomainWhoisResponseTest {
|
|||
ContactResource adminContact;
|
||||
ContactResource registrant;
|
||||
ContactResource techContact;
|
||||
DomainResource domainResource;
|
||||
DomainBase domainBase;
|
||||
|
||||
private final FakeClock clock = new FakeClock(DateTime.parse("2009-05-29T20:15:00Z"));
|
||||
|
||||
|
@ -229,7 +229,7 @@ public class DomainWhoisResponseTest {
|
|||
Key<ContactResource> adminResourceKey = Key.create(adminContact);
|
||||
Key<ContactResource> techResourceKey = Key.create(techContact);
|
||||
|
||||
domainResource = persistResource(new DomainResource.Builder()
|
||||
domainBase = persistResource(new DomainBase.Builder()
|
||||
.setFullyQualifiedDomainName("example.tld")
|
||||
.setRepoId("3-TLD")
|
||||
.setLastEppUpdateTime(DateTime.parse("2009-05-29T20:13:00Z"))
|
||||
|
@ -256,7 +256,7 @@ public class DomainWhoisResponseTest {
|
|||
@Test
|
||||
public void getPlainTextOutputTest() {
|
||||
DomainWhoisResponse domainWhoisResponse =
|
||||
new DomainWhoisResponse(domainResource, false, clock.nowUtc());
|
||||
new DomainWhoisResponse(domainBase, false, clock.nowUtc());
|
||||
assertThat(
|
||||
domainWhoisResponse.getResponse(
|
||||
false,
|
||||
|
@ -268,7 +268,7 @@ public class DomainWhoisResponseTest {
|
|||
public void getPlainTextOutputTest_registrarAbuseInfoMissing() {
|
||||
persistResource(abuseContact.asBuilder().setVisibleInDomainWhoisAsAbuse(false).build());
|
||||
DomainWhoisResponse domainWhoisResponse =
|
||||
new DomainWhoisResponse(domainResource, false, clock.nowUtc());
|
||||
new DomainWhoisResponse(domainBase, false, clock.nowUtc());
|
||||
assertThat(domainWhoisResponse.getResponse(false, "Footer"))
|
||||
.isEqualTo(
|
||||
WhoisResponseResults.create(
|
||||
|
@ -278,7 +278,7 @@ public class DomainWhoisResponseTest {
|
|||
@Test
|
||||
public void getPlainTextOutputTest_fullOutput() {
|
||||
DomainWhoisResponse domainWhoisResponse =
|
||||
new DomainWhoisResponse(domainResource, true, clock.nowUtc());
|
||||
new DomainWhoisResponse(domainBase, true, clock.nowUtc());
|
||||
assertThat(
|
||||
domainWhoisResponse.getResponse(
|
||||
false,
|
||||
|
@ -290,7 +290,7 @@ public class DomainWhoisResponseTest {
|
|||
public void addImplicitOkStatusTest() {
|
||||
DomainWhoisResponse domainWhoisResponse =
|
||||
new DomainWhoisResponse(
|
||||
domainResource.asBuilder().setStatusValues(null).build(), false, clock.nowUtc());
|
||||
domainBase.asBuilder().setStatusValues(null).build(), false, clock.nowUtc());
|
||||
assertThat(
|
||||
domainWhoisResponse
|
||||
.getResponse(
|
||||
|
|
|
@ -26,7 +26,7 @@ import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
|||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistSimpleResources;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainBase;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts;
|
||||
|
@ -45,7 +45,7 @@ import com.google.appengine.api.datastore.DatastoreTimeoutException;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
|
@ -118,8 +118,8 @@ public class WhoisActionTest {
|
|||
assertThat(response.getPayload()).isEqualTo(loadFile("whois_action_no_command.txt"));
|
||||
}
|
||||
|
||||
private DomainResource makeDomainResourceWithRegistrar(Registrar registrar) {
|
||||
return makeDomainResource(
|
||||
private DomainBase makeDomainBaseWithRegistrar(Registrar registrar) {
|
||||
return makeDomainBase(
|
||||
"cat.lol",
|
||||
persistResource(makeContactResource("5372808-ERL", "Goblin Market", "lol@cat.lol")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Santa Claus", "BOFH@cat.lol")),
|
||||
|
@ -133,7 +133,7 @@ public class WhoisActionTest {
|
|||
public void testRun_domainQuery_works() {
|
||||
Registrar registrar =
|
||||
persistResource(makeRegistrar("evilregistrar", "Yes Virginia", ACTIVE));
|
||||
persistResource(makeDomainResourceWithRegistrar(registrar));
|
||||
persistResource(makeDomainBaseWithRegistrar(registrar));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
newWhoisAction("domain cat.lol\r\n").run();
|
||||
assertThat(response.getStatus()).isEqualTo(200);
|
||||
|
@ -144,11 +144,11 @@ public class WhoisActionTest {
|
|||
public void testRun_domainQuery_usesCache() {
|
||||
Registrar registrar =
|
||||
persistResource(makeRegistrar("evilregistrar", "Yes Virginia", ACTIVE));
|
||||
persistResource(makeDomainResourceWithRegistrar(registrar));
|
||||
persistResource(makeDomainBaseWithRegistrar(registrar));
|
||||
persistSimpleResources(makeRegistrarContacts(registrar));
|
||||
// Populate the cache for both the domain and contact.
|
||||
DomainResource domain =
|
||||
loadByForeignKeyCached(DomainResource.class, "cat.lol", clock.nowUtc()).get();
|
||||
DomainBase domain =
|
||||
loadByForeignKeyCached(DomainBase.class, "cat.lol", clock.nowUtc()).get();
|
||||
ContactResource contact =
|
||||
loadByForeignKeyCached(ContactResource.class, "5372808-ERL", clock.nowUtc()).get();
|
||||
// Make a change to the domain and contact that won't be seen because the cache will be hit.
|
||||
|
@ -172,7 +172,7 @@ public class WhoisActionTest {
|
|||
public void testRun_domainAfterTransfer_hasUpdatedEppTimeAndClientId() {
|
||||
Registrar registrar = persistResource(makeRegistrar("TheRegistrar", "Yes Virginia", ACTIVE));
|
||||
persistResource(
|
||||
makeDomainResourceWithRegistrar(registrar)
|
||||
makeDomainBaseWithRegistrar(registrar)
|
||||
.asBuilder()
|
||||
.setTransferData(
|
||||
new TransferData.Builder()
|
||||
|
@ -197,7 +197,7 @@ public class WhoisActionTest {
|
|||
public void testRun_idnDomain_works() {
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", ACTIVE));
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.みんな",
|
||||
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.みんな")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Santa Claus", "BOFH@cat.みんな")),
|
||||
|
@ -215,7 +215,7 @@ public class WhoisActionTest {
|
|||
public void testRun_punycodeDomain_works() {
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", ACTIVE));
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.みんな",
|
||||
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.みんな")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Santa Claus", "BOFH@cat.みんな")),
|
||||
|
@ -239,7 +239,7 @@ public class WhoisActionTest {
|
|||
@Test
|
||||
public void testRun_domainNotFound_usesCache() {
|
||||
// Populate the cache with the nonexistence of this domain.
|
||||
assertThat(loadByForeignKeyCached(DomainResource.class, "cat.lol", clock.nowUtc())).isEmpty();
|
||||
assertThat(loadByForeignKeyCached(DomainBase.class, "cat.lol", clock.nowUtc())).isEmpty();
|
||||
// Add a new valid cat.lol domain that won't be found because the cache will be hit instead.
|
||||
persistActiveDomain("cat.lol");
|
||||
newWhoisAction("domain cat.lol\r\n").run();
|
||||
|
@ -254,7 +254,7 @@ public class WhoisActionTest {
|
|||
persistResource(Registry.get("lol").asBuilder().setTldType(Registry.TldType.TEST).build());
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", ACTIVE));
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.lol",
|
||||
persistResource(makeContactResource("5372808-ERL", "Goblin Market", "lol@cat.lol")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Santa Claus", "BOFH@cat.lol")),
|
||||
|
@ -271,7 +271,7 @@ public class WhoisActionTest {
|
|||
@Test
|
||||
public void testRun_domainFlaggedAsDeletedInDatastore_isConsideredNotFound() {
|
||||
Registrar registrar;
|
||||
persistResource(makeDomainResource("cat.lol",
|
||||
persistResource(makeDomainBase("cat.lol",
|
||||
persistResource(
|
||||
makeContactResource("5372808-ERL", "Peter Murphy", "lol@cat.lol")),
|
||||
persistResource(
|
||||
|
@ -296,7 +296,7 @@ public class WhoisActionTest {
|
|||
@Test
|
||||
public void testRun_domainDeletedThenRecreated_isFound() {
|
||||
Registrar registrar;
|
||||
DomainResource domain1 = persistResource(makeDomainResource("cat.lol",
|
||||
DomainBase domain1 = persistResource(makeDomainBase("cat.lol",
|
||||
persistResource(
|
||||
makeContactResource("5372808-ERL", "Peter Murphy", "lol@cat.lol")),
|
||||
persistResource(
|
||||
|
@ -309,7 +309,7 @@ public class WhoisActionTest {
|
|||
makeRegistrar("example", "Example Registrar", ACTIVE))).asBuilder()
|
||||
.setCreationTimeForTest(clock.nowUtc().minusDays(2))
|
||||
.setDeletionTime(clock.nowUtc().minusDays(1)).build());
|
||||
DomainResource domain2 = persistResource(makeDomainResource("cat.lol",
|
||||
DomainBase domain2 = persistResource(makeDomainBase("cat.lol",
|
||||
persistResource(
|
||||
makeContactResource(
|
||||
"5372809-ERL", "Mrs. Alice Crypto", "alice@example.lol")),
|
||||
|
@ -522,7 +522,7 @@ public class WhoisActionTest {
|
|||
public void testRun_multilevelDomain_isNotConsideredAHostname() {
|
||||
Registrar registrar =
|
||||
persistResource(makeRegistrar("example", "Example Registrar", ACTIVE));
|
||||
persistResource(makeDomainResource("cat.1.test",
|
||||
persistResource(makeDomainBase("cat.1.test",
|
||||
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.1.test")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Santa Claus", "BOFH@cat.1.test")),
|
||||
persistResource(makeContactResource("5372808-TRL", "The Raven", "bog@cat.1.test")),
|
||||
|
|
|
@ -21,7 +21,7 @@ import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
|||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistSimpleResources;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeContactResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeDomainBase;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeHostResource;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrar;
|
||||
import static google.registry.testing.FullFieldsTestEntityHelper.makeRegistrarContacts;
|
||||
|
@ -122,7 +122,7 @@ public class WhoisHttpActionTest {
|
|||
persistResource(Registry.get("lol").asBuilder().setTldType(Registry.TldType.TEST).build());
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", Registrar.State.ACTIVE));
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.lol",
|
||||
persistResource(makeContactResource("5372808-ERL", "Goblin Market", "lol@cat.lol")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Santa Claus", "BOFH@cat.lol")),
|
||||
|
@ -141,7 +141,7 @@ public class WhoisHttpActionTest {
|
|||
public void testRun_domainQueryIdn_works() {
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", Registrar.State.ACTIVE));
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.みんな",
|
||||
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.みんな")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Santa Claus", "BOFH@cat.みんな")),
|
||||
|
@ -167,7 +167,7 @@ public class WhoisHttpActionTest {
|
|||
.setOrg("Galactic\r\nEmpire")
|
||||
.build())
|
||||
.build());
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.みんな", trl,
|
||||
trl,
|
||||
trl,
|
||||
|
@ -180,7 +180,7 @@ public class WhoisHttpActionTest {
|
|||
|
||||
@Test
|
||||
public void testRun_domainOnly_works() {
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.みんな",
|
||||
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.みんな")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Operator", "BOFH@cat.みんな")),
|
||||
|
@ -204,7 +204,7 @@ public class WhoisHttpActionTest {
|
|||
public void testRun_domainQueryPunycode_works() {
|
||||
Registrar registrar = persistResource(makeRegistrar(
|
||||
"evilregistrar", "Yes Virginia", Registrar.State.ACTIVE));
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.みんな",
|
||||
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.みんな")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Santa Claus", "BOFH@cat.みんな")),
|
||||
|
@ -269,7 +269,7 @@ public class WhoisHttpActionTest {
|
|||
|
||||
@Test
|
||||
public void testRun_uppercaseDomain_ignoresCasing() {
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.lol",
|
||||
persistResource(makeContactResource("5372808-ERL", "Peter Murphy", "lol@cat.lol")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Operator", "BOFH@cat.lol")),
|
||||
|
@ -283,7 +283,7 @@ public class WhoisHttpActionTest {
|
|||
|
||||
@Test
|
||||
public void testRun_hairyPath_getsDecoded() {
|
||||
persistResource(makeDomainResource(
|
||||
persistResource(makeDomainBase(
|
||||
"cat.lol",
|
||||
persistResource(makeContactResource("5372808-ERL", "Peter Murphy", "lol@cat.lol")),
|
||||
persistResource(makeContactResource("5372808-IRL", "Operator", "BOFH@cat.lol")),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue