Add domain pa notification response to first delete domain poll message (#1400)

* Add domain pa notification response to first delete domain poll message

* Add test case for poll message

* Change time in response data to now
This commit is contained in:
Rachel Guan 2021-10-28 15:45:50 -04:00 committed by GitHub
parent 0978ede5d9
commit f5d269c76d
4 changed files with 60 additions and 1 deletions

View file

@ -371,6 +371,10 @@ public final class DomainDeleteFlow implements TransactionalFlow {
String.format(
"Domain %s was deleted by registry administrator with final deletion effective: %s",
existingDomain.getDomainName(), deletionTime))
.setResponseData(
ImmutableList.of(
DomainPendingActionNotificationResponse.create(
existingDomain.getDomainName(), true, trid, now)))
.build();
}

View file

@ -838,14 +838,19 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response_pending.xml"));
HistoryEntry deleteHistoryEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
DateTime now = clock.nowUtc();
assertPollMessages(
new PollMessage.OneTime.Builder()
.setRegistrarId("TheRegistrar")
.setParent(deleteHistoryEntry)
.setEventTime(clock.nowUtc())
.setEventTime(now)
.setMsg(
"Domain example.tld was deleted by registry administrator with final deletion"
+ " effective: 2000-07-11T22:00:00.013Z")
.setResponseData(
ImmutableList.of(
DomainPendingActionNotificationResponse.create(
"example.tld", true, deleteHistoryEntry.getTrid(), now)))
.build(),
new PollMessage.OneTime.Builder()
.setRegistrarId("TheRegistrar")

View file

@ -156,6 +156,30 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
runFlowAssertResponse(loadFile("poll_response_domain_pending_notification.xml"));
}
@TestOfyAndSql
void testSuccess_domainPendingActionImmediateDelete() throws Exception {
persistResource(
new PollMessage.OneTime.Builder()
.setRegistrarId(getRegistrarIdForFlow())
.setEventTime(clock.nowUtc())
.setMsg(
String.format(
"Domain %s was deleted by registry administrator with final deletion"
+ " effective: %s",
domain.getDomainName(), clock.nowUtc().minusMinutes(5)))
.setResponseData(
ImmutableList.of(
DomainPendingActionNotificationResponse.create(
domain.getDomainName(),
true,
Trid.create("ABC-12345", "other-trid"),
clock.nowUtc())))
.setParent(createHistoryEntryForEppResource(domain))
.build());
assertTransactionalFlow(false);
runFlowAssertResponse(loadFile("poll_message_domain_pending_action_immediate_delete.xml"));
}
@TestOfyAndSql
void testSuccess_domainAutorenewMessage() throws Exception {
persistResource(

View file

@ -0,0 +1,26 @@
<epp xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:fee="urn:ietf:params:xml:ns:fee-0.6" xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0" xmlns:fee11="urn:ietf:params:xml:ns:fee-0.11" xmlns:fee12="urn:ietf:params:xml:ns:fee-0.12" xmlns:launch="urn:ietf:params:xml:ns:launch-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns:host="urn:ietf:params:xml:ns:host-1.0">
<response>
<result code="1301">
<msg>Command completed successfully; ack to dequeue</msg>
</result>
<msgQ count="1" id="1-3-EXAMPLE-5-6-2011">
<qDate>2011-01-02T01:01:01Z</qDate>
<msg>Domain test.example was deleted by registry administrator with final deletion effective: 2011-01-02T00:56:01.009Z</msg>
</msgQ>
<resData>
<domain:panData>
<domain:name paResult="1">test.example</domain:name>
<domain:paTRID>
<clTRID>ABC-12345</clTRID>
<svTRID>other-trid</svTRID>
</domain:paTRID>
<domain:paDate>2011-01-02T01:01:01Z</domain:paDate>
</domain:panData>
</resData>
<trID>
<clTRID>ABC-12345</clTRID>
<svTRID>server-trid</svTRID>
</trID>
</response>
</epp>