mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 00:42:12 +02:00
Remove nearly all uses of ReferenceUnion
ReferenceUnion is a hack to work around the mismatch between how we store references (by roid) and how they are represented in EPP (by foreign key). If it ever needed to exist (not entirely clear...) it should have remained tightly scoped within the domain commands and resources. Instead it has leaked everywhere in the project, causing lots of boilerplate. This CL hides all of that behind standard Refs, and should be followed by work to remove ReferenceUnion completely. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122424416
This commit is contained in:
parent
56c8bb0f2a
commit
9a2afc7a9b
59 changed files with 448 additions and 454 deletions
|
@ -40,7 +40,6 @@ 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.ReferenceUnion;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.poll.PendingActionNotificationResponse;
|
||||
|
@ -79,8 +78,7 @@ public class DeleteContactResourceActionTest
|
|||
assertAboutContacts().that(contactUsed).doesNotHaveStatusValue(StatusValue.PENDING_DELETE)
|
||||
.and().hasDeletionTime(END_OF_TIME);
|
||||
domain = loadByUniqueId(DomainResource.class, "example.tld", now);
|
||||
assertThat(domain.getReferencedContacts())
|
||||
.contains(ReferenceUnion.<ContactResource>create(Ref.create(contactUsed)));
|
||||
assertThat(domain.getReferencedContacts()).contains(Ref.create(contactUsed));
|
||||
HistoryEntry historyEntry =
|
||||
getOnlyHistoryEntryOfType(contactUsed, HistoryEntry.Type.CONTACT_DELETE_FAILURE);
|
||||
assertPollMessageFor(
|
||||
|
|
|
@ -29,11 +29,11 @@ import com.google.common.base.Optional;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.Ref;
|
||||
|
||||
import google.registry.mapreduce.MapreduceRunner;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.ofy.Ofy;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
|
@ -84,7 +84,7 @@ public abstract class DeleteEppResourceActionTestCase<T extends DeleteEppResourc
|
|||
hostUsed = persistActiveHost("ns1.example.tld");
|
||||
domain = persistResource(
|
||||
newDomainResource("example.tld", contactUsed).asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(hostUsed)))
|
||||
.setNameservers(ImmutableSet.of(Ref.create(hostUsed)))
|
||||
.build());
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ import com.googlecode.objectify.Key;
|
|||
import com.googlecode.objectify.Ref;
|
||||
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
@ -68,8 +67,7 @@ public class DeleteHostResourceActionTest
|
|||
assertAboutHosts().that(hostUsed).doesNotHaveStatusValue(StatusValue.PENDING_DELETE)
|
||||
.and().hasDeletionTime(END_OF_TIME);
|
||||
domain = loadByUniqueId(DomainResource.class, "example.tld", now);
|
||||
assertThat(domain.getNameservers())
|
||||
.contains(ReferenceUnion.<HostResource>create(Ref.create(hostUsed)));
|
||||
assertThat(domain.getNameservers()).contains(Ref.create(hostUsed));
|
||||
HistoryEntry historyEntry =
|
||||
getOnlyHistoryEntryOfType(hostUsed, HistoryEntry.Type.HOST_DELETE_FAILURE);
|
||||
assertPollMessageFor(
|
||||
|
|
|
@ -30,10 +30,10 @@ import com.google.common.base.Optional;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.Ref;
|
||||
|
||||
import google.registry.dns.DnsQueue;
|
||||
import google.registry.mapreduce.MapreduceRunner;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.request.HttpException.BadRequestException;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
|
@ -77,21 +77,21 @@ public class DnsRefreshForHostRenameActionTest
|
|||
@Test
|
||||
public void testSuccess_dnsUpdateEnqueued() throws Exception {
|
||||
createTld("tld");
|
||||
HostResource renamedHost = persistActiveHost("ns1.example.tld");
|
||||
HostResource otherHost = persistActiveHost("ns2.example.tld");
|
||||
Ref<HostResource> renamedHostRef = Ref.create(persistActiveHost("ns1.example.tld"));
|
||||
Ref<HostResource> otherHostRef = Ref.create(persistActiveHost("ns2.example.tld"));
|
||||
persistResource(newDomainApplication("notadomain.tld").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(renamedHost)))
|
||||
.setNameservers(ImmutableSet.of(renamedHostRef))
|
||||
.build());
|
||||
persistResource(newDomainResource("example.tld").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(renamedHost)))
|
||||
.setNameservers(ImmutableSet.of(renamedHostRef))
|
||||
.build());
|
||||
persistResource(newDomainResource("otherexample.tld").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(renamedHost)))
|
||||
.setNameservers(ImmutableSet.of(renamedHostRef))
|
||||
.build());
|
||||
persistResource(newDomainResource("untouched.tld").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(otherHost)))
|
||||
.setNameservers(ImmutableSet.of(otherHostRef))
|
||||
.build());
|
||||
runMapreduce(Key.create(renamedHost).getString());
|
||||
runMapreduce(renamedHostRef.getKey().getString());
|
||||
verify(dnsQueue).addDomainRefreshTask("example.tld");
|
||||
verify(dnsQueue).addDomainRefreshTask("otherexample.tld");
|
||||
verifyNoMoreInteractions(dnsQueue);
|
||||
|
@ -100,12 +100,12 @@ public class DnsRefreshForHostRenameActionTest
|
|||
@Test
|
||||
public void testSuccess_noDnsTasksForDeletedDomain() throws Exception {
|
||||
createTld("tld");
|
||||
HostResource renamedHost = persistActiveHost("ns1.example.tld");
|
||||
Ref<HostResource> renamedHostRef = Ref.create(persistActiveHost("ns1.example.tld"));
|
||||
persistResource(newDomainResource("example.tld").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(renamedHost)))
|
||||
.setNameservers(ImmutableSet.of(renamedHostRef))
|
||||
.setDeletionTime(START_OF_TIME)
|
||||
.build());
|
||||
runMapreduce(Key.create(renamedHost).getString());
|
||||
runMapreduce(renamedHostRef.getKey().getString());
|
||||
verifyZeroInteractions(dnsQueue);
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ import google.registry.flows.domain.DomainFlowUtils.LaunchPhaseMismatchException
|
|||
import google.registry.flows.domain.DomainFlowUtils.LeadingDashException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.LinkedResourceDoesNotExistException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.MissingContactTypeException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NameserverNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NameserversNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NoMarksFoundMatchingDomainException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.PremiumNameBlockedException;
|
||||
|
@ -1191,7 +1191,7 @@ public class DomainApplicationCreateFlowTest
|
|||
persistResource(Registry.get("tld").asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns2.example.net"))
|
||||
.build());
|
||||
thrown.expect(NameserverNotAllowedException.class, "ns1.example.net");
|
||||
thrown.expect(NameserversNotAllowedException.class, "ns1.example.net");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ import static google.registry.testing.GenericEppResourceSubject.assertAboutEppRe
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import com.googlecode.objectify.Ref;
|
||||
|
||||
import google.registry.flows.EppException.UnimplementedExtensionException;
|
||||
import google.registry.flows.FlowRunner.CommitMode;
|
||||
import google.registry.flows.FlowRunner.UserPrivileges;
|
||||
|
@ -41,7 +43,6 @@ import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException
|
|||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.domain.launch.LaunchPhase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
@ -89,10 +90,10 @@ public class DomainApplicationDeleteFlowTest
|
|||
persistResource(newDomainApplication("example.tld").asBuilder()
|
||||
.setRepoId("1-TLD")
|
||||
.setRegistrant(
|
||||
ReferenceUnion.create(
|
||||
Ref.create(
|
||||
loadByUniqueId(ContactResource.class, "sh8013", clock.nowUtc())))
|
||||
.setNameservers(ImmutableSet.of(
|
||||
ReferenceUnion.create(
|
||||
Ref.create(
|
||||
loadByUniqueId(HostResource.class, "ns1.example.net", clock.nowUtc()))))
|
||||
.build());
|
||||
doSuccessfulTest();
|
||||
|
|
|
@ -26,6 +26,8 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import com.googlecode.objectify.Ref;
|
||||
|
||||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceFlowUtils.ResourceNotOwnedException;
|
||||
import google.registry.flows.ResourceQueryFlow.ResourceToQueryDoesNotExistException;
|
||||
|
@ -37,7 +39,6 @@ import google.registry.model.domain.DesignatedContact;
|
|||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.domain.launch.ApplicationStatus;
|
||||
import google.registry.model.domain.launch.LaunchCreateExtension;
|
||||
import google.registry.model.domain.launch.LaunchPhase;
|
||||
|
@ -89,12 +90,12 @@ public class DomainApplicationInfoFlowTest
|
|||
.setCreationTimeForTest(DateTime.parse("1999-04-03T22:00:00.0Z"))
|
||||
.setLastEppUpdateTime(DateTime.parse("1999-12-03T09:00:00.0Z"))
|
||||
.setLastTransferTime(DateTime.parse("2000-04-08T09:00:00.0Z"))
|
||||
.setRegistrant(ReferenceUnion.create(registrant))
|
||||
.setRegistrant(Ref.create(registrant))
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.ADMIN, ReferenceUnion.create(contact)),
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(contact))))
|
||||
DesignatedContact.create(Type.ADMIN, Ref.create(contact)),
|
||||
DesignatedContact.create(Type.TECH, Ref.create(contact))))
|
||||
.setNameservers(hostsState.equals(HostsState.HOSTS_EXIST) ? ImmutableSet.of(
|
||||
ReferenceUnion.create(host1), ReferenceUnion.create(host2)) : null)
|
||||
Ref.create(host1), Ref.create(host2)) : null)
|
||||
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("2fooBAR")))
|
||||
.addStatusValue(StatusValue.PENDING_CREATE)
|
||||
.setApplicationStatus(ApplicationStatus.PENDING_VALIDATION)
|
||||
|
@ -244,7 +245,7 @@ public class DomainApplicationInfoFlowTest
|
|||
.setDsData(ImmutableSet.of(DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
.setNameservers(ImmutableSet.of(
|
||||
ReferenceUnion.create(host1), ReferenceUnion.create(host2)))
|
||||
Ref.create(host1), Ref.create(host2)))
|
||||
.build());
|
||||
doSuccessfulTest("domain_info_sunrise_response_dsdata.xml", HostsState.NO_HOSTS_EXIST);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@ import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import com.googlecode.objectify.Ref;
|
||||
|
||||
import google.registry.flows.EppException.UnimplementedExtensionException;
|
||||
import google.registry.flows.FlowRunner.CommitMode;
|
||||
import google.registry.flows.FlowRunner.UserPrivileges;
|
||||
|
@ -50,7 +52,7 @@ import google.registry.flows.domain.DomainFlowUtils.LinkedResourceDoesNotExistEx
|
|||
import google.registry.flows.domain.DomainFlowUtils.MissingAdminContactException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.MissingContactTypeException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.MissingTechnicalContactException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NameserverNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NameserversNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.RegistrantNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.TooManyDsRecordsException;
|
||||
|
@ -60,7 +62,6 @@ import google.registry.model.domain.DesignatedContact;
|
|||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.DomainApplication;
|
||||
import google.registry.model.domain.DomainApplication.Builder;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.domain.launch.ApplicationStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
|
@ -108,9 +109,9 @@ public class DomainApplicationUpdateFlowTest
|
|||
private DomainApplication persistApplication() throws Exception {
|
||||
return persistResource(newApplicationBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.ADMIN, ReferenceUnion.create(unusedContact))))
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(
|
||||
DesignatedContact.create(Type.TECH, Ref.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.ADMIN, Ref.create(unusedContact))))
|
||||
.setNameservers(ImmutableSet.of(Ref.create(
|
||||
loadByUniqueId(HostResource.class, "ns1.example.tld", clock.nowUtc()))))
|
||||
.build());
|
||||
}
|
||||
|
@ -174,7 +175,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
persistReferencedEntities();
|
||||
ContactResource sh8013 = loadByUniqueId(ContactResource.class, "sh8013", clock.nowUtc());
|
||||
persistResource(
|
||||
newApplicationBuilder().setRegistrant(ReferenceUnion.create(sh8013)).build());
|
||||
newApplicationBuilder().setRegistrant(Ref.create(sh8013)).build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("domain_update_response.xml"));
|
||||
}
|
||||
|
@ -184,13 +185,13 @@ public class DomainApplicationUpdateFlowTest
|
|||
setEppInput("domain_update_sunrise_remove_multiple_contacts.xml");
|
||||
persistReferencedEntities();
|
||||
ContactResource sh8013 = loadByUniqueId(ContactResource.class, "sh8013", clock.nowUtc());
|
||||
ReferenceUnion<ContactResource> sh8013ReferenceUnion = ReferenceUnion.create(sh8013);
|
||||
Ref<ContactResource> sh8013Ref = Ref.create(sh8013);
|
||||
persistResource(newApplicationBuilder()
|
||||
.setRegistrant(sh8013ReferenceUnion)
|
||||
.setRegistrant(sh8013Ref)
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.ADMIN, sh8013ReferenceUnion),
|
||||
DesignatedContact.create(Type.BILLING, sh8013ReferenceUnion),
|
||||
DesignatedContact.create(Type.TECH, sh8013ReferenceUnion)))
|
||||
DesignatedContact.create(Type.ADMIN, sh8013Ref),
|
||||
DesignatedContact.create(Type.BILLING, sh8013Ref),
|
||||
DesignatedContact.create(Type.TECH, sh8013Ref)))
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("domain_update_response.xml"));
|
||||
|
@ -373,10 +374,10 @@ public class DomainApplicationUpdateFlowTest
|
|||
}
|
||||
|
||||
private void modifyApplicationToHave13Nameservers() throws Exception {
|
||||
ImmutableSet.Builder<ReferenceUnion<HostResource>> nameservers = new ImmutableSet.Builder<>();
|
||||
ImmutableSet.Builder<Ref<HostResource>> nameservers = new ImmutableSet.Builder<>();
|
||||
for (int i = 1; i < 15; i++) {
|
||||
if (i != 2) { // Skip 2 since that's the one that the tests will add.
|
||||
nameservers.add(ReferenceUnion.create(loadByUniqueId(
|
||||
nameservers.add(Ref.create(loadByUniqueId(
|
||||
HostResource.class, String.format("ns%d.example.tld", i), clock.nowUtc())));
|
||||
}
|
||||
}
|
||||
|
@ -496,7 +497,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
// Add a tech contact to the persisted entity, which should cause the flow to fail when it tries
|
||||
// to add "mak21" as a second tech contact.
|
||||
persistResource(reloadResourceByUniqueId().asBuilder().setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(
|
||||
DesignatedContact.create(Type.TECH, Ref.create(
|
||||
loadByUniqueId(ContactResource.class, "foo", clock.nowUtc()))))).build());
|
||||
runFlow();
|
||||
}
|
||||
|
@ -581,7 +582,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
setEppInput("domain_update_sunrise_add_remove_same_host.xml");
|
||||
persistReferencedEntities();
|
||||
persistResource(newApplicationBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(
|
||||
.setNameservers(ImmutableSet.of(Ref.create(
|
||||
loadByUniqueId(HostResource.class, "ns1.example.tld", clock.nowUtc()))))
|
||||
.build());
|
||||
runFlow();
|
||||
|
@ -595,7 +596,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
persistResource(newApplicationBuilder()
|
||||
.setContacts(ImmutableSet.of(DesignatedContact.create(
|
||||
Type.TECH,
|
||||
ReferenceUnion.create(
|
||||
Ref.create(
|
||||
loadByUniqueId(ContactResource.class, "sh8013", clock.nowUtc())))))
|
||||
.build());
|
||||
runFlow();
|
||||
|
@ -608,8 +609,8 @@ public class DomainApplicationUpdateFlowTest
|
|||
persistReferencedEntities();
|
||||
persistResource(newApplicationBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.ADMIN, ReferenceUnion.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(sh8013Contact))))
|
||||
DesignatedContact.create(Type.ADMIN, Ref.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.TECH, Ref.create(sh8013Contact))))
|
||||
.build());
|
||||
runFlow();
|
||||
}
|
||||
|
@ -621,8 +622,8 @@ public class DomainApplicationUpdateFlowTest
|
|||
persistReferencedEntities();
|
||||
persistResource(newApplicationBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.ADMIN, ReferenceUnion.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(sh8013Contact))))
|
||||
DesignatedContact.create(Type.ADMIN, Ref.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.TECH, Ref.create(sh8013Contact))))
|
||||
.build());
|
||||
runFlow();
|
||||
}
|
||||
|
@ -649,7 +650,7 @@ public class DomainApplicationUpdateFlowTest
|
|||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.foo"))
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
thrown.expect(NameserverNotAllowedException.class);
|
||||
thrown.expect(NameserversNotAllowedException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ import google.registry.flows.domain.DomainFlowUtils.MissingAdminContactException
|
|||
import google.registry.flows.domain.DomainFlowUtils.MissingContactTypeException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.MissingRegistrantException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.MissingTechnicalContactException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NameserverNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NameserversNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.PremiumNameBlockedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.RegistrantNotAllowedException;
|
||||
|
@ -1251,7 +1251,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
persistResource(Registry.get("tld").asBuilder()
|
||||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns2.example.net"))
|
||||
.build());
|
||||
thrown.expect(NameserverNotAllowedException.class, "ns1.example.net");
|
||||
thrown.expect(NameserversNotAllowedException.class, "ns1.example.net");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,6 @@ import google.registry.model.billing.BillingEvent.Reason;
|
|||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
|
@ -118,7 +117,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
ContactResource contact = persistActiveContact("sh8013");
|
||||
domain = newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.setCreationTimeForTest(TIME_BEFORE_FLOW)
|
||||
.setRegistrant(ReferenceUnion.create(contact))
|
||||
.setRegistrant(Ref.create(contact))
|
||||
.setRegistrationExpirationTime(expirationTime)
|
||||
.build();
|
||||
earlierHistoryEntry = persistResource(
|
||||
|
@ -466,14 +465,12 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
persistResource(loadByUniqueId(
|
||||
DomainResource.class, getUniqueIdFromCommand(), clock.nowUtc())
|
||||
.asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(host)))
|
||||
.setNameservers(ImmutableSet.of(Ref.create(host)))
|
||||
.build());
|
||||
// Persist another domain that's already been deleted and references this contact and host.
|
||||
persistResource(newDomainResource("example1.tld").asBuilder()
|
||||
.setRegistrant(
|
||||
ReferenceUnion.create(loadByUniqueId(
|
||||
ContactResource.class, "sh8013", clock.nowUtc())))
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(host)))
|
||||
.setRegistrant(Ref.create(loadByUniqueId(ContactResource.class, "sh8013", clock.nowUtc())))
|
||||
.setNameservers(ImmutableSet.of(Ref.create(host)))
|
||||
.setDeletionTime(START_OF_TIME)
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
|
|
|
@ -44,7 +44,6 @@ import google.registry.model.domain.DesignatedContact.Type;
|
|||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
|
@ -91,12 +90,11 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
|
|||
.setLastEppUpdateTime(DateTime.parse("1999-12-03T09:00:00.0Z"))
|
||||
.setLastTransferTime(DateTime.parse("2000-04-08T09:00:00.0Z"))
|
||||
.setRegistrationExpirationTime(DateTime.parse("2005-04-03T22:00:00.0Z"))
|
||||
.setRegistrant(ReferenceUnion.create(registrant))
|
||||
.setRegistrant(Ref.create(registrant))
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.ADMIN, ReferenceUnion.create(contact)),
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(contact))))
|
||||
.setNameservers(inactive ? null
|
||||
: ImmutableSet.of(ReferenceUnion.create(host1), ReferenceUnion.create(host2)))
|
||||
DesignatedContact.create(Type.ADMIN, Ref.create(contact)),
|
||||
DesignatedContact.create(Type.TECH, Ref.create(contact))))
|
||||
.setNameservers(inactive ? null : ImmutableSet.of(Ref.create(host1), Ref.create(host2)))
|
||||
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("2fooBAR")))
|
||||
.build());
|
||||
// Set the superordinate domain of ns1.example.com to example.com. In reality, this would have
|
||||
|
@ -243,8 +241,7 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
|
|||
persistResource(domain.asBuilder()
|
||||
.setDsData(ImmutableSet.of(DelegationSignerData.create(
|
||||
12345, 3, 1, base16().decode("49FD46E6C4B45C55D4AC"))))
|
||||
.setNameservers(ImmutableSet.of(
|
||||
ReferenceUnion.create(host1), ReferenceUnion.create(host3)))
|
||||
.setNameservers(ImmutableSet.of(Ref.create(host1), Ref.create(host3)))
|
||||
.build());
|
||||
doSuccessfulTest("domain_info_response_dsdata.xml", false);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ import google.registry.model.domain.DesignatedContact.Type;
|
|||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
|
@ -123,18 +122,14 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
|||
.setCreationClientId("TheRegistrar")
|
||||
.setCreationTimeForTest(DateTime.parse("1999-04-03T22:00:00.0Z"))
|
||||
.setRegistrationExpirationTime(REGISTRATION_EXPIRATION_TIME)
|
||||
.setRegistrant(
|
||||
ReferenceUnion.create(loadByUniqueId(
|
||||
ContactResource.class, "jd1234", clock.nowUtc())))
|
||||
.setRegistrant(Ref.create(loadByUniqueId(ContactResource.class, "jd1234", clock.nowUtc())))
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(
|
||||
Type.ADMIN,
|
||||
ReferenceUnion.create(
|
||||
loadByUniqueId(ContactResource.class, "jd1234", clock.nowUtc()))),
|
||||
Ref.create(loadByUniqueId(ContactResource.class, "jd1234", clock.nowUtc()))),
|
||||
DesignatedContact.create(
|
||||
Type.TECH,
|
||||
ReferenceUnion.create(
|
||||
loadByUniqueId(ContactResource.class, "jd1234", clock.nowUtc())))))
|
||||
Ref.create(loadByUniqueId(ContactResource.class, "jd1234", clock.nowUtc())))))
|
||||
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("fooBAR")))
|
||||
.addGracePeriod(GracePeriod.create(
|
||||
GracePeriodStatus.ADD, clock.nowUtc().plusDays(10), "foo", null))
|
||||
|
|
|
@ -62,7 +62,7 @@ import google.registry.flows.domain.DomainFlowUtils.LinkedResourceInPendingDelet
|
|||
import google.registry.flows.domain.DomainFlowUtils.MissingAdminContactException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.MissingContactTypeException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.MissingTechnicalContactException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NameserverNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NameserversNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.NotAuthorizedForTldException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.RegistrantNotAllowedException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.TooManyDsRecordsException;
|
||||
|
@ -74,7 +74,6 @@ import google.registry.model.domain.DesignatedContact;
|
|||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
|
@ -123,9 +122,9 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
DomainResource domain = persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.ADMIN, ReferenceUnion.create(unusedContact))))
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(host)))
|
||||
DesignatedContact.create(Type.TECH, Ref.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.ADMIN, Ref.create(unusedContact))))
|
||||
.setNameservers(ImmutableSet.of(Ref.create(host)))
|
||||
.build());
|
||||
historyEntryDomainCreate = persistResource(
|
||||
new HistoryEntry.Builder()
|
||||
|
@ -180,7 +179,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
HistoryEntry historyEntryDomainUpdate =
|
||||
getOnlyHistoryEntryOfType(resource, HistoryEntry.Type.DOMAIN_UPDATE);
|
||||
assertThat(resource.getNameservers()).containsExactly(
|
||||
ReferenceUnion.create(
|
||||
Ref.create(
|
||||
loadByUniqueId(HostResource.class, "ns2.example.foo", clock.nowUtc())));
|
||||
BillingEvent.OneTime regularAddBillingEvent = new BillingEvent.OneTime.Builder()
|
||||
.setReason(Reason.CREATE)
|
||||
|
@ -278,7 +277,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
// serverHold on it.
|
||||
persistResource(
|
||||
reloadResourceByUniqueId().asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(
|
||||
.setNameservers(ImmutableSet.of(Ref.create(
|
||||
loadByUniqueId(HostResource.class, "ns2.example.foo", clock.nowUtc()))))
|
||||
.addGracePeriod(GracePeriod.forBillingEvent(
|
||||
GracePeriodStatus.SUNRUSH_ADD, sunrushAddBillingEvent))
|
||||
|
@ -302,7 +301,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
// serverHold on it.
|
||||
persistResource(
|
||||
reloadResourceByUniqueId().asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(
|
||||
.setNameservers(ImmutableSet.of(Ref.create(
|
||||
loadByUniqueId(HostResource.class, "ns2.example.foo", clock.nowUtc()))))
|
||||
.addGracePeriod(GracePeriod.forBillingEvent(
|
||||
GracePeriodStatus.SUNRUSH_ADD, sunrushAddBillingEvent))
|
||||
|
@ -345,10 +344,10 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
}
|
||||
|
||||
private void modifyDomainToHave13Nameservers() throws Exception {
|
||||
ImmutableSet.Builder<ReferenceUnion<HostResource>> nameservers = new ImmutableSet.Builder<>();
|
||||
ImmutableSet.Builder<Ref<HostResource>> nameservers = new ImmutableSet.Builder<>();
|
||||
for (int i = 1; i < 15; i++) {
|
||||
if (i != 2) { // Skip 2 since that's the one that the tests will add.
|
||||
nameservers.add(ReferenceUnion.create(loadByUniqueId(
|
||||
nameservers.add(Ref.create(loadByUniqueId(
|
||||
HostResource.class, String.format("ns%d.example.foo", i), clock.nowUtc())));
|
||||
}
|
||||
}
|
||||
|
@ -374,11 +373,11 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
persistDomain();
|
||||
setEppInput("domain_update_max_everything.xml");
|
||||
// Create 26 hosts and 8 contacts. Start the domain with half of them.
|
||||
ImmutableSet.Builder<ReferenceUnion<HostResource>> nameservers = new ImmutableSet.Builder<>();
|
||||
ImmutableSet.Builder<Ref<HostResource>> nameservers = new ImmutableSet.Builder<>();
|
||||
for (int i = 0; i < 26; i++) {
|
||||
HostResource host = persistActiveHost(String.format("max_test_%d.example.tld", i));
|
||||
if (i < 13) {
|
||||
nameservers.add(ReferenceUnion.create(host));
|
||||
nameservers.add(Ref.create(host));
|
||||
}
|
||||
}
|
||||
ImmutableSet.Builder<DesignatedContact> contacts = new ImmutableSet.Builder<>();
|
||||
|
@ -388,7 +387,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
contacts.add(
|
||||
DesignatedContact.create(
|
||||
DesignatedContact.Type.values()[i],
|
||||
ReferenceUnion.create(contact)));
|
||||
Ref.create(contact)));
|
||||
}
|
||||
}
|
||||
persistResource(
|
||||
|
@ -407,7 +406,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
assertThat(domain.getNameservers()).hasSize(13);
|
||||
// getContacts does not return contacts of type REGISTRANT, so check these separately.
|
||||
assertThat(domain.getContacts()).hasSize(3);
|
||||
assertThat(domain.getRegistrant().getLinked().get().getContactId()).isEqualTo("max_test_7");
|
||||
assertThat(domain.getRegistrant().get().getContactId()).isEqualTo("max_test_7");
|
||||
assertNoBillingEvents();
|
||||
assertDnsTasksEnqueued("example.tld");
|
||||
}
|
||||
|
@ -459,14 +458,14 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
domain = persistResource(domain.asBuilder()
|
||||
.addSubordinateHost("ns1.example.tld")
|
||||
.addSubordinateHost("ns2.example.tld")
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(
|
||||
.setNameservers(ImmutableSet.of(Ref.create(
|
||||
loadByUniqueId(HostResource.class, "ns1.example.tld", clock.nowUtc()))))
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
assertTransactionalFlow(true);
|
||||
runFlowAssertResponse(readFile("domain_update_response.xml"));
|
||||
domain = reloadResourceByUniqueId();
|
||||
assertThat(domain.getNameservers()).containsExactly(ReferenceUnion.create(addedHost));
|
||||
assertThat(domain.getNameservers()).containsExactly(Ref.create(addedHost));
|
||||
assertThat(domain.getSubordinateHosts()).containsExactly("ns1.example.tld", "ns2.example.tld");
|
||||
existingHost = loadByUniqueId(HostResource.class, "ns1.example.tld", clock.nowUtc());
|
||||
addedHost = loadByUniqueId(HostResource.class, "ns2.example.tld", clock.nowUtc());
|
||||
|
@ -481,7 +480,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
ContactResource sh8013 = loadByUniqueId(ContactResource.class, "sh8013", clock.nowUtc());
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.setRegistrant(ReferenceUnion.create(sh8013))
|
||||
.setRegistrant(Ref.create(sh8013))
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("domain_update_response.xml"));
|
||||
|
@ -492,14 +491,14 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
setEppInput("domain_update_remove_multiple_contacts.xml");
|
||||
persistReferencedEntities();
|
||||
ContactResource sh8013 = loadByUniqueId(ContactResource.class, "sh8013", clock.nowUtc());
|
||||
ReferenceUnion<ContactResource> sh8013ReferenceUnion = ReferenceUnion.create(sh8013);
|
||||
Ref<ContactResource> sh8013Ref = Ref.create(sh8013);
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.setRegistrant(sh8013ReferenceUnion)
|
||||
.setRegistrant(sh8013Ref)
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.ADMIN, sh8013ReferenceUnion),
|
||||
DesignatedContact.create(Type.BILLING, sh8013ReferenceUnion),
|
||||
DesignatedContact.create(Type.TECH, sh8013ReferenceUnion)))
|
||||
DesignatedContact.create(Type.ADMIN, sh8013Ref),
|
||||
DesignatedContact.create(Type.BILLING, sh8013Ref),
|
||||
DesignatedContact.create(Type.TECH, sh8013Ref)))
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("domain_update_response.xml"));
|
||||
|
@ -891,7 +890,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
persistResource(
|
||||
reloadResourceByUniqueId().asBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(
|
||||
DesignatedContact.create(Type.TECH, Ref.create(
|
||||
loadByUniqueId(ContactResource.class, "foo", clock.nowUtc())))))
|
||||
.build());
|
||||
runFlow();
|
||||
|
@ -988,7 +987,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
persistReferencedEntities();
|
||||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(
|
||||
.setNameservers(ImmutableSet.of(Ref.create(
|
||||
loadByUniqueId(HostResource.class, "ns1.example.foo", clock.nowUtc()))))
|
||||
.build());
|
||||
runFlow();
|
||||
|
@ -1003,7 +1002,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.setContacts(ImmutableSet.of(DesignatedContact.create(
|
||||
Type.TECH,
|
||||
ReferenceUnion.create(
|
||||
Ref.create(
|
||||
loadByUniqueId(ContactResource.class, "sh8013", clock.nowUtc())))))
|
||||
.build());
|
||||
runFlow();
|
||||
|
@ -1017,8 +1016,8 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.ADMIN, ReferenceUnion.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(sh8013Contact))))
|
||||
DesignatedContact.create(Type.ADMIN, Ref.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.TECH, Ref.create(sh8013Contact))))
|
||||
.build());
|
||||
runFlow();
|
||||
}
|
||||
|
@ -1031,8 +1030,8 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
persistResource(
|
||||
newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.setContacts(ImmutableSet.of(
|
||||
DesignatedContact.create(Type.ADMIN, ReferenceUnion.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.TECH, ReferenceUnion.create(sh8013Contact))))
|
||||
DesignatedContact.create(Type.ADMIN, Ref.create(sh8013Contact)),
|
||||
DesignatedContact.create(Type.TECH, Ref.create(sh8013Contact))))
|
||||
.build());
|
||||
runFlow();
|
||||
}
|
||||
|
@ -1094,7 +1093,7 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
.setAllowedFullyQualifiedHostNames(ImmutableSet.of("ns1.example.foo"))
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
thrown.expect(NameserverNotAllowedException.class);
|
||||
thrown.expect(NameserversNotAllowedException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ import static google.registry.testing.TaskQueueHelper.assertTasksEnqueued;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.Ref;
|
||||
|
||||
import google.registry.flows.FlowRunner.CommitMode;
|
||||
import google.registry.flows.FlowRunner.UserPrivileges;
|
||||
|
@ -41,7 +42,6 @@ import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistExce
|
|||
import google.registry.flows.SingleResourceFlow.ResourceStatusProhibitsOperationException;
|
||||
import google.registry.flows.async.DeleteEppResourceAction;
|
||||
import google.registry.flows.async.DeleteHostResourceAction;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
|
@ -179,7 +179,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
createTld("tld");
|
||||
persistResource(newDomainResource("example.tld").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(
|
||||
ReferenceUnion.create(persistActiveHost(getUniqueIdFromCommand()))))
|
||||
Ref.create(persistActiveHost(getUniqueIdFromCommand()))))
|
||||
.build());
|
||||
thrown.expect(ResourceToDeleteIsReferencedException.class);
|
||||
runFlow();
|
||||
|
@ -190,7 +190,7 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
createTld("tld");
|
||||
persistResource(newDomainApplication("example.tld").asBuilder()
|
||||
.setNameservers(ImmutableSet.of(
|
||||
ReferenceUnion.create(persistActiveHost(getUniqueIdFromCommand()))))
|
||||
Ref.create(persistActiveHost(getUniqueIdFromCommand()))))
|
||||
.build());
|
||||
thrown.expect(ResourceToDeleteIsReferencedException.class);
|
||||
runFlow();
|
||||
|
|
|
@ -29,7 +29,6 @@ import com.googlecode.objectify.Ref;
|
|||
import google.registry.flows.ResourceFlowTestCase;
|
||||
import google.registry.flows.ResourceQueryFlow.ResourceToQueryDoesNotExistException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
|
||||
|
@ -94,7 +93,7 @@ public class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostRes
|
|||
persistResource(
|
||||
newDomainResource("example.foobar").asBuilder()
|
||||
.addNameservers(
|
||||
ImmutableSet.of(ReferenceUnion.<HostResource>create(persistHostResource(true))))
|
||||
ImmutableSet.of(Ref.<HostResource>create(persistHostResource(true))))
|
||||
.build());
|
||||
assertTransactionalFlow(false);
|
||||
// Check that the persisted host info was returned.
|
||||
|
|
|
@ -58,7 +58,6 @@ import google.registry.flows.host.HostUpdateFlow.HostAlreadyExistsException;
|
|||
import google.registry.flows.host.HostUpdateFlow.RenameHostToExternalRemoveIpException;
|
||||
import google.registry.flows.host.HostUpdateFlow.RenameHostToSubordinateRequiresIpException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.ReferenceUnion;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
|
@ -162,7 +161,7 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
persistResource(
|
||||
newDomainResource("test.xn--q9jyb4c").asBuilder()
|
||||
.setDeletionTime(END_OF_TIME)
|
||||
.setNameservers(ImmutableSet.of(ReferenceUnion.create(host)))
|
||||
.setNameservers(ImmutableSet.of(Ref.create(host)))
|
||||
.build());
|
||||
HostResource renamedHost = doSuccessfulTest();
|
||||
assertThat(renamedHost.getSuperordinateDomain()).isNull();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue