mirror of
https://github.com/google/nomulus.git
synced 2025-08-03 16:32:11 +02:00
Add more absent clTrid unit tests
In RFC 5730, clTrid is specified as optional. We ran into an error earlier this year in which a registrar was not passing a client transaction id and we didn't handle it correctly. So, this CL adds some tests of common EPP operations verify that they work correctly when the clTrid is not specified. This also slightly improves some flow logic to make it more obvious at first glance that clTrid is indeed optional. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202000845
This commit is contained in:
parent
6706b99828
commit
ed910455b0
21 changed files with 252 additions and 33 deletions
|
@ -59,28 +59,42 @@ public class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
|||
host = persistActiveHost("ns1.test.example");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_domainTransferApproved() throws Exception {
|
||||
private void persistPendingTransferPollMessage() {
|
||||
persistResource(
|
||||
new PollMessage.OneTime.Builder()
|
||||
.setClientId(getClientIdForFlow())
|
||||
.setEventTime(clock.nowUtc().minusDays(1))
|
||||
.setMsg("Transfer approved.")
|
||||
.setResponseData(ImmutableList.of(new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName("test.example")
|
||||
.setTransferStatus(TransferStatus.SERVER_APPROVED)
|
||||
.setGainingClientId(getClientIdForFlow())
|
||||
.setTransferRequestTime(clock.nowUtc().minusDays(5))
|
||||
.setLosingClientId("TheRegistrar")
|
||||
.setPendingTransferExpirationTime(clock.nowUtc().minusDays(1))
|
||||
.setExtendedRegistrationExpirationTime(clock.nowUtc().plusYears(1))
|
||||
.build()))
|
||||
.setResponseData(
|
||||
ImmutableList.of(
|
||||
new DomainTransferResponse.Builder()
|
||||
.setFullyQualifiedDomainName("test.example")
|
||||
.setTransferStatus(TransferStatus.SERVER_APPROVED)
|
||||
.setGainingClientId(getClientIdForFlow())
|
||||
.setTransferRequestTime(clock.nowUtc().minusDays(5))
|
||||
.setLosingClientId("TheRegistrar")
|
||||
.setPendingTransferExpirationTime(clock.nowUtc().minusDays(1))
|
||||
.setExtendedRegistrationExpirationTime(clock.nowUtc().plusYears(1))
|
||||
.build()))
|
||||
.setParent(createHistoryEntryForEppResource(domain))
|
||||
.build());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_domainTransferApproved() throws Exception {
|
||||
persistPendingTransferPollMessage();
|
||||
assertTransactionalFlow(false);
|
||||
runFlowAssertResponse(loadFile("poll_response_domain_transfer.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_clTridNotSpecified() throws Exception {
|
||||
setEppInput("poll_no_cltrid.xml");
|
||||
persistPendingTransferPollMessage();
|
||||
assertTransactionalFlow(false);
|
||||
runFlowAssertResponse(loadFile("poll_response_domain_transfer_no_cltrid.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_contactTransferPending() throws Exception {
|
||||
clock.setTo(DateTime.parse("2000-06-13T22:00:00.0Z"));
|
||||
|
|
5
javatests/google/registry/flows/poll/testdata/poll_no_cltrid.xml
vendored
Normal file
5
javatests/google/registry/flows/poll/testdata/poll_no_cltrid.xml
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<poll op="req"/>
|
||||
</command>
|
||||
</epp>
|
25
javatests/google/registry/flows/poll/testdata/poll_response_domain_transfer_no_cltrid.xml
vendored
Normal file
25
javatests/google/registry/flows/poll/testdata/poll_response_domain_transfer_no_cltrid.xml
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-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-01T01:01:01Z</qDate>
|
||||
<msg>Transfer approved.</msg>
|
||||
</msgQ>
|
||||
<resData>
|
||||
<domain:trnData xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>test.example</domain:name>
|
||||
<domain:trStatus>serverApproved</domain:trStatus>
|
||||
<domain:reID>NewRegistrar</domain:reID>
|
||||
<domain:reDate>2010-12-28T01:01:01Z</domain:reDate>
|
||||
<domain:acID>TheRegistrar</domain:acID>
|
||||
<domain:acDate>2011-01-01T01:01:01Z</domain:acDate>
|
||||
<domain:exDate>2012-01-02T01:01:01Z</domain:exDate>
|
||||
</domain:trnData>
|
||||
</resData>
|
||||
<trID>
|
||||
<svTRID>server-trid</svTRID>
|
||||
</trID>
|
||||
</response>
|
||||
</epp>
|
Loading…
Add table
Add a link
Reference in a new issue