mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +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
|
@ -107,14 +107,11 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
ContactResource unusedContact;
|
||||
HistoryEntry historyEntryDomainCreate;
|
||||
|
||||
public DomainUpdateFlowTest() {
|
||||
// Note that "domain_update.xml" tests adding and removing the same contact type.
|
||||
setEppInput("domain_update.xml");
|
||||
}
|
||||
|
||||
@Before
|
||||
public void initDomainTest() {
|
||||
createTld("tld");
|
||||
// Note that "domain_update.xml" tests adding and removing the same contact type.
|
||||
setEppInput("domain_update.xml");
|
||||
}
|
||||
|
||||
private void persistReferencedEntities() {
|
||||
|
@ -149,8 +146,12 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
}
|
||||
|
||||
private void doSuccessfulTest() throws Exception {
|
||||
doSuccessfulTest("domain_update_response.xml");
|
||||
}
|
||||
|
||||
private void doSuccessfulTest(String expectedXmlFilename) throws Exception {
|
||||
assertTransactionalFlow(true);
|
||||
runFlowAssertResponse(loadFile("domain_update_response.xml"));
|
||||
runFlowAssertResponse(loadFile(expectedXmlFilename));
|
||||
// Check that the domain was updated. These values came from the xml.
|
||||
assertAboutDomains()
|
||||
.that(reloadResourceByForeignKey())
|
||||
|
@ -178,6 +179,14 @@ public class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow,
|
|||
doSuccessfulTest();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_clTridNotSpecified() throws Exception {
|
||||
setEppInput("domain_update_no_cltrid.xml");
|
||||
persistReferencedEntities();
|
||||
persistDomain();
|
||||
doSuccessfulTest("generic_success_response_no_cltrid.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_cachingDisabled() throws Exception {
|
||||
RegistryConfig.overrideIsEppResourceCachingEnabledForTesting(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue