mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 12:31:08 +02:00
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:
parent
0978ede5d9
commit
f5d269c76d
4 changed files with 60 additions and 1 deletions
|
@ -371,6 +371,10 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
||||||
String.format(
|
String.format(
|
||||||
"Domain %s was deleted by registry administrator with final deletion effective: %s",
|
"Domain %s was deleted by registry administrator with final deletion effective: %s",
|
||||||
existingDomain.getDomainName(), deletionTime))
|
existingDomain.getDomainName(), deletionTime))
|
||||||
|
.setResponseData(
|
||||||
|
ImmutableList.of(
|
||||||
|
DomainPendingActionNotificationResponse.create(
|
||||||
|
existingDomain.getDomainName(), true, trid, now)))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -838,14 +838,19 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||||
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response_pending.xml"));
|
CommitMode.LIVE, UserPrivileges.SUPERUSER, loadFile("domain_delete_response_pending.xml"));
|
||||||
|
|
||||||
HistoryEntry deleteHistoryEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
HistoryEntry deleteHistoryEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||||
|
DateTime now = clock.nowUtc();
|
||||||
assertPollMessages(
|
assertPollMessages(
|
||||||
new PollMessage.OneTime.Builder()
|
new PollMessage.OneTime.Builder()
|
||||||
.setRegistrarId("TheRegistrar")
|
.setRegistrarId("TheRegistrar")
|
||||||
.setParent(deleteHistoryEntry)
|
.setParent(deleteHistoryEntry)
|
||||||
.setEventTime(clock.nowUtc())
|
.setEventTime(now)
|
||||||
.setMsg(
|
.setMsg(
|
||||||
"Domain example.tld was deleted by registry administrator with final deletion"
|
"Domain example.tld was deleted by registry administrator with final deletion"
|
||||||
+ " effective: 2000-07-11T22:00:00.013Z")
|
+ " effective: 2000-07-11T22:00:00.013Z")
|
||||||
|
.setResponseData(
|
||||||
|
ImmutableList.of(
|
||||||
|
DomainPendingActionNotificationResponse.create(
|
||||||
|
"example.tld", true, deleteHistoryEntry.getTrid(), now)))
|
||||||
.build(),
|
.build(),
|
||||||
new PollMessage.OneTime.Builder()
|
new PollMessage.OneTime.Builder()
|
||||||
.setRegistrarId("TheRegistrar")
|
.setRegistrarId("TheRegistrar")
|
||||||
|
|
|
@ -156,6 +156,30 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
runFlowAssertResponse(loadFile("poll_response_domain_pending_notification.xml"));
|
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
|
@TestOfyAndSql
|
||||||
void testSuccess_domainAutorenewMessage() throws Exception {
|
void testSuccess_domainAutorenewMessage() throws Exception {
|
||||||
persistResource(
|
persistResource(
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue