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-20 11:34:58 -07:00 committed by Justine Tunney
parent 38e7b07c93
commit b83b3b313f
56 changed files with 2505 additions and 13 deletions

View file

@ -85,6 +85,9 @@ public class DomainTransferRequestFlowTest
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");
@Before
public void setUp() throws Exception {
@ -350,6 +353,12 @@ public class DomainTransferRequestFlowTest
"domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_11_MAP);
}
@Test
public void testSuccess_fee_v12() throws Exception {
doSuccessfulTest(
"domain_transfer_request_fee.xml", "domain_transfer_request_response_fee.xml", FEE_12_MAP);
}
@Test
public void testSuccess_fee_withDefaultAttributes_v06() throws Exception {
doSuccessfulTest(
@ -366,19 +375,31 @@ public class DomainTransferRequestFlowTest
FEE_11_MAP);
}
@Test
public void testSuccess_fee_withDefaultAttributes_v12() throws Exception {
doSuccessfulTest(
"domain_transfer_request_fee_defaults.xml",
"domain_transfer_request_response_fee.xml",
FEE_12_MAP);
}
@Test
public void testFailure_refundableFee_v06() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
doFailingTest("domain_transfer_request_fee_refundable.xml", FEE_06_MAP);
}
@Test
public void testFailure_refundableFee_v11() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
doFailingTest("domain_transfer_request_fee_refundable.xml", FEE_11_MAP);
}
@Test
public void testFailure_refundableFee_v12() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
doFailingTest("domain_transfer_request_fee_refundable.xml", FEE_12_MAP);
}
@Test
public void testFailure_gracePeriodFee_v06() throws Exception {
@ -392,6 +413,12 @@ public class DomainTransferRequestFlowTest
doFailingTest("domain_transfer_request_fee_grace_period.xml", FEE_11_MAP);
}
@Test
public void testFailure_gracePeriodFee_v12() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
doFailingTest("domain_transfer_request_fee_grace_period.xml", FEE_12_MAP);
}
@Test
public void testFailure_appliedFee_v06() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
@ -404,6 +431,12 @@ public class DomainTransferRequestFlowTest
doFailingTest("domain_transfer_request_fee_applied.xml", FEE_11_MAP);
}
@Test
public void testFailure_appliedFee_v12() throws Exception {
thrown.expect(UnsupportedFeeAttributeException.class);
doFailingTest("domain_transfer_request_fee_applied.xml", FEE_12_MAP);
}
@Test
public void testSuccess_nonDefaultAutomaticTransferLength() throws Exception {
persistResource(
@ -532,6 +565,11 @@ public class DomainTransferRequestFlowTest
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);
@ -544,6 +582,13 @@ public class DomainTransferRequestFlowTest
doFailingTest("domain_transfer_request_fee_bad_scale.xml", FEE_11_MAP);
}
@Test
public void testFailure_feeGivenInWrongScale_v12() throws Exception {
thrown.expect(CurrencyValueScaleException.class);
doFailingTest("domain_transfer_request_fee_bad_scale.xml", FEE_12_MAP);
}
private void runWrongFeeAmountTest(Map<String, String> substitutions) throws Exception {
thrown.expect(FeesMismatchException.class);
persistResource(
@ -564,6 +609,11 @@ public class DomainTransferRequestFlowTest
runWrongFeeAmountTest(FEE_11_MAP);
}
@Test
public void testFailure_wrongFeeAmount_v12() throws Exception {
runWrongFeeAmountTest(FEE_12_MAP);
}
@Test
public void testFailure_premiumBlocked() throws Exception {
thrown.expect(PremiumNameBlockedException.class);