mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Remove the fallback trid logic in DomainAllocateFlow.
There are no applications extant that predate the creationTrid field. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=136047561
This commit is contained in:
parent
bffc98c6ea
commit
70afce13fe
2 changed files with 3 additions and 23 deletions
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
package google.registry.flows.domain;
|
package google.registry.flows.domain;
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
import static google.registry.flows.domain.DomainFlowUtils.getReservationType;
|
import static google.registry.flows.domain.DomainFlowUtils.getReservationType;
|
||||||
import static google.registry.model.EppResourceUtils.loadDomainApplication;
|
import static google.registry.model.EppResourceUtils.loadDomainApplication;
|
||||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||||
|
@ -137,19 +136,7 @@ public class DomainAllocateFlow extends DomainCreateOrAllocateFlow {
|
||||||
DomainPendingActionNotificationResponse.create(
|
DomainPendingActionNotificationResponse.create(
|
||||||
application.getFullyQualifiedDomainName(),
|
application.getFullyQualifiedDomainName(),
|
||||||
true,
|
true,
|
||||||
// If the creation TRID is not present on the application (this can happen for
|
application.getCreationTrid(),
|
||||||
// older applications written before this field was added), then we must read
|
|
||||||
// the earliest history entry for the application to retrieve it.
|
|
||||||
application.getCreationTrid() == null
|
|
||||||
? checkNotNull(ofy()
|
|
||||||
.load()
|
|
||||||
.type(HistoryEntry.class)
|
|
||||||
.ancestor(application)
|
|
||||||
.order("modificationTime")
|
|
||||||
.first()
|
|
||||||
.now()
|
|
||||||
.getTrid())
|
|
||||||
: application.getCreationTrid(),
|
|
||||||
now)))
|
now)))
|
||||||
.setResponseExtensions(ImmutableList.of(
|
.setResponseExtensions(ImmutableList.of(
|
||||||
new LaunchInfoResponseExtension.Builder()
|
new LaunchInfoResponseExtension.Builder()
|
||||||
|
|
|
@ -107,6 +107,7 @@ public class DomainAllocateFlowTest
|
||||||
"collision-label,NAME_COLLISION")).build());
|
"collision-label,NAME_COLLISION")).build());
|
||||||
String domainName = getUniqueIdFromCommand();
|
String domainName = getUniqueIdFromCommand();
|
||||||
application = persistResource(newDomainApplication(domainName).asBuilder()
|
application = persistResource(newDomainApplication(domainName).asBuilder()
|
||||||
|
.setCreationTrid(TRID)
|
||||||
.setEncodedSignedMarks(ImmutableList.of(EncodedSignedMark.create("base64", "abcdef")))
|
.setEncodedSignedMarks(ImmutableList.of(EncodedSignedMark.create("base64", "abcdef")))
|
||||||
.build());
|
.build());
|
||||||
for (int i = 1; i <= 14; ++i) {
|
for (int i = 1; i <= 14; ++i) {
|
||||||
|
@ -114,14 +115,6 @@ public class DomainAllocateFlowTest
|
||||||
}
|
}
|
||||||
persistActiveContact("jd1234");
|
persistActiveContact("jd1234");
|
||||||
persistActiveContact("sh8013");
|
persistActiveContact("sh8013");
|
||||||
// Add a history entry under this application that corresponds to its creation.
|
|
||||||
persistResource(
|
|
||||||
new HistoryEntry.Builder()
|
|
||||||
.setParent(application)
|
|
||||||
.setType(HistoryEntry.Type.DOMAIN_APPLICATION_CREATE)
|
|
||||||
.setModificationTime(APPLICATION_TIME)
|
|
||||||
.setTrid(TRID)
|
|
||||||
.build());
|
|
||||||
clock.setTo(DateTime.parse("2010-09-16T10:00:00.0Z"));
|
clock.setTo(DateTime.parse("2010-09-16T10:00:00.0Z"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +138,7 @@ public class DomainAllocateFlowTest
|
||||||
DomainApplication application = loadDomainApplication(applicationId, clock.nowUtc());
|
DomainApplication application = loadDomainApplication(applicationId, clock.nowUtc());
|
||||||
assertAboutApplications().that(application)
|
assertAboutApplications().that(application)
|
||||||
.hasApplicationStatus(ApplicationStatus.ALLOCATED).and()
|
.hasApplicationStatus(ApplicationStatus.ALLOCATED).and()
|
||||||
.hasHistoryEntryAtIndex(1)
|
.hasHistoryEntryAtIndex(0)
|
||||||
.which().hasType(HistoryEntry.Type.DOMAIN_APPLICATION_STATUS_UPDATE);
|
.which().hasType(HistoryEntry.Type.DOMAIN_APPLICATION_STATUS_UPDATE);
|
||||||
|
|
||||||
String domainName = getUniqueIdFromCommand();
|
String domainName = getUniqueIdFromCommand();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue