Use TldSpecificLogicProxy to fetch renew price in DomainRenewFlow

The renew flow was still using PricingEngineProxy directly, meaning that it did not pick up on any TLD-specific pricing logic. Fixed this, and added tests to make sure.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136757922
This commit is contained in:
mountford 2016-10-20 14:10:43 -07:00 committed by Ben McIlwain
parent ae7933da57
commit fd1c68ffb9
4 changed files with 34 additions and 8 deletions

View file

@ -613,11 +613,20 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
runFlow();
}
@Test
public void testFailure_flags_feeMismatch() throws Exception {
setEppInput("domain_renew_flags.xml", ImmutableMap.of("FEE", "11"));
persistDomain();
thrown.expect(FeesMismatchException.class);
runFlow();
}
@Test
public void testSuccess_flags() throws Exception {
setEppInput("domain_renew_flags.xml");
setEppInput("domain_renew_flags.xml", ImmutableMap.of("FEE", "42"));
persistDomain();
thrown.expect(TestExtraLogicManagerSuccessException.class, "renewed");
runFlow();
}
}

View file

@ -3,11 +3,17 @@
<renew>
<domain:renew
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.flags</domain:name>
<domain:name>create-42.flags</domain:name>
<domain:curExpDate>2000-04-03</domain:curExpDate>
<domain:period unit="y">5</domain:period>
<domain:period unit="y">1</domain:period>
</domain:renew>
</renew>
<extension>
<fee:renew xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
<fee:currency>USD</fee:currency>
<fee:fee>%FEE%</fee:fee>
</fee:renew>
</extension>
<clTRID>ABC-12345</clTRID>
</command>
</epp>

View file

@ -58,6 +58,15 @@ public class TestExtraLogicManager implements RegistryExtraFlowLogic {
}
}
/**
* Gets the flags to be used in the EPP flags extension for info commands.
*
* <p>The test extra logic manager uses domain names differently for info commands than for other
* flows. In other flows, the test logic needs returns (via the success exception) the flags found
* in the incoming message. But for info commands, there aren't any incoming flags, only outgoing
* ones. So we need to specify the flags using a dummy domain name; those flags can then be
* inserted into the outgoing info response.
*/
@Override
public Set<String> getExtensionFlags(
DomainResource domainResource, String clientId, DateTime asOfDate) {