Support version 0.12 of the EPP Fee Extension

The corresponding version of the specification is 8.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127968603
This commit is contained in:
Brian Mountford
2016-07-21 14:55:08 -04:00
committed by Justine Tunney
parent 38e7b07c93
commit b83b3b313f
56 changed files with 2505 additions and 13 deletions
@@ -72,6 +72,8 @@ public class DomainRestoreRequestFlowTest extends
ImmutableMap.of("FEE_VERSION", "0.6", "FEE_NS", "fee");
private static final ImmutableMap<String, String> FEE_11_MAP =
ImmutableMap.of("FEE_VERSION", "0.11", "FEE_NS", "fee11");
private static final ImmutableMap<String, String> FEE_12_MAP =
ImmutableMap.of("FEE_VERSION", "0.12", "FEE_NS", "fee12");
public DomainRestoreRequestFlowTest() {
setEppInput("domain_update_restore_request.xml");
@@ -195,6 +197,12 @@ public class DomainRestoreRequestFlowTest extends
runFlowAssertResponse(readFile("domain_update_restore_request_response_fee.xml", FEE_11_MAP));
}
@Test
public void testSuccess_fee_v12() throws Exception {
setEppInput("domain_update_restore_request_fee.xml", FEE_12_MAP);
persistPendingDeleteDomain();
runFlowAssertResponse(readFile("domain_update_restore_request_response_fee.xml", FEE_12_MAP));
}
@Test
public void testSuccess_fee_withDefaultAttributes_v06() throws Exception {
setEppInput("domain_update_restore_request_fee_defaults.xml", FEE_06_MAP);
@@ -209,6 +217,13 @@ public class DomainRestoreRequestFlowTest extends
runFlowAssertResponse(readFile("domain_update_restore_request_response_fee.xml", FEE_11_MAP));
}
@Test
public void testSuccess_fee_withDefaultAttributes_v12() throws Exception {
setEppInput("domain_update_restore_request_fee_defaults.xml", FEE_12_MAP);
persistPendingDeleteDomain();
runFlowAssertResponse(readFile("domain_update_restore_request_response_fee.xml", FEE_12_MAP));
}
@Test
public void testFailure_refundableFee_v06() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
@@ -225,6 +240,14 @@ public class DomainRestoreRequestFlowTest extends
runFlow();
}
@Test
public void testFailure_refundableFee_v12() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
setEppInput("domain_update_restore_request_fee_refundable.xml", FEE_12_MAP);
persistPendingDeleteDomain();
runFlow();
}
@Test
public void testFailure_gracePeriodFee_v06() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
@@ -241,6 +264,14 @@ public class DomainRestoreRequestFlowTest extends
runFlow();
}
@Test
public void testFailure_gracePeriodFee_v12() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
setEppInput("domain_update_restore_request_fee_grace_period.xml", FEE_12_MAP);
persistPendingDeleteDomain();
runFlow();
}
@Test
public void testFailure_appliedFee_v06() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
@@ -257,6 +288,14 @@ public class DomainRestoreRequestFlowTest extends
runFlow();
}
@Test
public void testFailure_appliedFee_v12() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
setEppInput("domain_update_restore_request_fee_applied.xml", FEE_12_MAP);
persistPendingDeleteDomain();
runFlow();
}
@Test
public void testSuccess_premiumNotBlocked() throws Exception {
createTld("example");
@@ -323,6 +362,16 @@ public class DomainRestoreRequestFlowTest extends
runFlow();
}
@Test
public void testFailure_wrongFeeAmount_v12() throws Exception {
thrown.expect(FeesMismatchException.class);
setEppInput("domain_update_restore_request_fee.xml", FEE_12_MAP);
persistPendingDeleteDomain();
persistResource(
Registry.get("tld").asBuilder().setRestoreBillingCost(Money.of(USD, 100)).build());
runFlow();
}
private void runWrongCurrencyTest(Map<String, String> substitutions) throws Exception {
thrown.expect(CurrencyUnitMismatchException.class);
setEppInput("domain_update_restore_request_fee.xml", substitutions);
@@ -350,6 +399,11 @@ public class DomainRestoreRequestFlowTest extends
runWrongCurrencyTest(FEE_11_MAP);
}
@Test
public void testFailure_wrongCurrency_v12() throws Exception {
runWrongCurrencyTest(FEE_12_MAP);
}
@Test
public void testFailure_feeGivenInWrongScale_v06() throws Exception {
thrown.expect(CurrencyValueScaleException.class);
@@ -366,6 +420,14 @@ public class DomainRestoreRequestFlowTest extends
runFlow();
}
@Test
public void testFailure_feeGivenInWrongScale_v12() throws Exception {
thrown.expect(CurrencyValueScaleException.class);
setEppInput("domain_update_restore_request_fee_bad_scale.xml", FEE_12_MAP);
persistPendingDeleteDomain();
runFlow();
}
@Test
public void testFailure_notInRedemptionPeriod() throws Exception {
thrown.expect(DomainNotEligibleForRestoreException.class);