mirror of
https://github.com/google/nomulus.git
synced 2025-08-05 09:21:49 +02:00
Add extra flow logic for Restore
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137191080
This commit is contained in:
parent
a4d78afd70
commit
e40db46822
5 changed files with 38 additions and 11 deletions
|
@ -615,7 +615,8 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
|
||||
@Test
|
||||
public void testFailure_flags_feeMismatch() throws Exception {
|
||||
setEppInput("domain_renew_flags.xml", ImmutableMap.of("FEE", "11"));
|
||||
setEppInput(
|
||||
"domain_renew_flags.xml", ImmutableMap.of("DOMAIN", "renew-42.flags", "FEE", "11"));
|
||||
persistDomain();
|
||||
thrown.expect(FeesMismatchException.class);
|
||||
runFlow();
|
||||
|
@ -623,7 +624,8 @@ public class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, D
|
|||
|
||||
@Test
|
||||
public void testSuccess_flags() throws Exception {
|
||||
setEppInput("domain_renew_flags.xml", ImmutableMap.of("FEE", "42"));
|
||||
setEppInput(
|
||||
"domain_renew_flags.xml", ImmutableMap.of("DOMAIN", "renew-42.flags", "FEE", "42"));
|
||||
persistDomain();
|
||||
thrown.expect(TestExtraLogicManagerSuccessException.class, "renewed");
|
||||
runFlow();
|
||||
|
|
|
@ -554,8 +554,22 @@ public class DomainRestoreRequestFlowTest extends
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_flags() throws Exception {
|
||||
setEppInput("domain_update_restore_request_flags.xml");
|
||||
public void testFlags_flagsWithWrongFee() throws Exception {
|
||||
setEppInput(
|
||||
"domain_update_restore_request_flags.xml",
|
||||
ImmutableMap.of("DOMAIN", "renew-42.flags", "FEE", "12"));
|
||||
persistPendingDeleteDomain();
|
||||
thrown.expect(FeesMismatchException.class);
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_flagsWithCorrectFee() throws Exception {
|
||||
// The total cost should be the renewal cost of 42 (set in the XML file) plus the restore cost
|
||||
// of 17 (set in the test registry).
|
||||
setEppInput(
|
||||
"domain_update_restore_request_flags.xml",
|
||||
ImmutableMap.of("DOMAIN", "renew-42.flags", "FEE", "59"));
|
||||
persistPendingDeleteDomain();
|
||||
thrown.expect(TestExtraLogicManagerSuccessException.class, "restored");
|
||||
runFlow();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<renew>
|
||||
<domain:renew
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>create-42.flags</domain:name>
|
||||
<domain:name>%DOMAIN%</domain:name>
|
||||
<domain:curExpDate>2000-04-03</domain:curExpDate>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
</domain:renew>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<update>
|
||||
<domain:update
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.flags</domain:name>
|
||||
<domain:name>%DOMAIN%</domain:name>
|
||||
<domain:chg/>
|
||||
</domain:update>
|
||||
</update>
|
||||
|
@ -11,6 +11,10 @@
|
|||
<rgp:update xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0">
|
||||
<rgp:restore op="request"/>
|
||||
</rgp:update>
|
||||
<fee:update xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
|
||||
<fee:currency>USD</fee:currency>
|
||||
<fee:fee>%FEE%</fee:fee>
|
||||
</fee:update>
|
||||
</extension>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue