mirror of
https://github.com/google/nomulus.git
synced 2025-06-04 11:37:25 +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
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue