mirror of
https://github.com/google/nomulus
synced 2026-09-05 07:37:09 +00: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:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user