mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
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:
parent
38e7b07c93
commit
b83b3b313f
56 changed files with 2505 additions and 13 deletions
|
@ -396,6 +396,13 @@ public class DomainCheckFlowTest
|
|||
runFlowAssertResponse(readFile("domain_check_fee_response_v11.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_v12() throws Exception {
|
||||
persistActiveDomain("example1.tld");
|
||||
setEppInput("domain_check_fee_v12.xml");
|
||||
runFlowAssertResponse(readFile("domain_check_fee_response_v12.xml"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test commands for create, renew, transfer, restore and update with implicit period and
|
||||
* currency. */
|
||||
|
@ -407,6 +414,12 @@ public class DomainCheckFlowTest
|
|||
|
||||
// Version 11 cannot have multiple commands.
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_multipleCommands_v12() throws Exception {
|
||||
setEppInput("domain_check_fee_multiple_commands_v12.xml");
|
||||
runFlowAssertResponse(readFile("domain_check_fee_multiple_commands_response_v12.xml"));
|
||||
}
|
||||
|
||||
/** Test the same as {@link #testFeeExtension_multipleCommands_v06} with premium labels. */
|
||||
@Test
|
||||
public void testFeeExtension_premiumLabels_v06() throws Exception {
|
||||
|
@ -450,6 +463,13 @@ public class DomainCheckFlowTest
|
|||
runFlowAssertResponse(readFile("domain_check_fee_premium_response_v11_update.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_premiumLabels_v12() throws Exception {
|
||||
createTld("example");
|
||||
setEppInput("domain_check_fee_premium_v12.xml");
|
||||
runFlowAssertResponse(readFile("domain_check_fee_premium_response_v12.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_fractionalCost() throws Exception {
|
||||
// Note that the response xml expects to see "11.10" with two digits after the decimal point.
|
||||
|
@ -514,6 +534,16 @@ public class DomainCheckFlowTest
|
|||
runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v11_restore.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_reservedName_v12() throws Exception {
|
||||
persistResource(Registry.get("tld").asBuilder()
|
||||
.setReservedLists(createReservedList())
|
||||
.setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70"))
|
||||
.build());
|
||||
setEppInput("domain_check_fee_reserved_v12.xml");
|
||||
runFlowAssertResponse(readFile("domain_check_fee_reserved_response_v12.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_feesNotOmittedOnReservedNamesInSunrise_v06() throws Exception {
|
||||
createTld("tld", TldState.SUNRISE);
|
||||
|
@ -573,6 +603,17 @@ public class DomainCheckFlowTest
|
|||
runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v11_restore.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_feesNotOmittedOnReservedNamesInSunrise_v12() throws Exception {
|
||||
createTld("tld", TldState.SUNRISE);
|
||||
persistResource(Registry.get("tld").asBuilder()
|
||||
.setReservedLists(createReservedList())
|
||||
.setPremiumList(persistPremiumList("tld", "premiumcollision,USD 70"))
|
||||
.build());
|
||||
setEppInput("domain_check_fee_reserved_v12.xml");
|
||||
runFlowAssertResponse(readFile("domain_check_fee_reserved_sunrise_response_v12.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_wrongCurrency_v06() throws Exception {
|
||||
thrown.expect(CurrencyUnitMismatchException.class);
|
||||
|
@ -587,6 +628,13 @@ public class DomainCheckFlowTest
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_wrongCurrency_v12() throws Exception {
|
||||
thrown.expect(CurrencyUnitMismatchException.class);
|
||||
setEppInput("domain_check_fee_euro_v12.xml");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_periodNotInYears_v06() throws Exception {
|
||||
thrown.expect(BadPeriodUnitException.class);
|
||||
|
@ -601,6 +649,13 @@ public class DomainCheckFlowTest
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_periodNotInYears_v12() throws Exception {
|
||||
thrown.expect(BadPeriodUnitException.class);
|
||||
setEppInput("domain_check_fee_bad_period_v12.xml");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_commandWithPhase_v06() throws Exception {
|
||||
thrown.expect(FeeChecksDontSupportPhasesException.class);
|
||||
|
@ -615,6 +670,13 @@ public class DomainCheckFlowTest
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_commandWithPhase_v12() throws Exception {
|
||||
thrown.expect(FeeChecksDontSupportPhasesException.class);
|
||||
setEppInput("domain_check_fee_command_phase_v12.xml");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_commandSubphase_v06() throws Exception {
|
||||
thrown.expect(FeeChecksDontSupportPhasesException.class);
|
||||
|
@ -629,6 +691,13 @@ public class DomainCheckFlowTest
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_commandSubphase_v12() throws Exception {
|
||||
thrown.expect(FeeChecksDontSupportPhasesException.class);
|
||||
setEppInput("domain_check_fee_command_subphase_v12.xml");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
// This test is only relevant for v06, since domain names are not specified in v11 or v12.
|
||||
@Test
|
||||
public void testFeeExtension_feeCheckNotInAvailabilityCheck() throws Exception {
|
||||
|
@ -651,6 +720,13 @@ public class DomainCheckFlowTest
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_multiyearRestore_v12() throws Exception {
|
||||
thrown.expect(RestoresAreAlwaysForOneYearException.class);
|
||||
setEppInput("domain_check_fee_multiyear_restore_v12.xml");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_unknownCommand_v06() throws Exception {
|
||||
thrown.expect(UnknownFeeCommandException.class);
|
||||
|
@ -665,6 +741,13 @@ public class DomainCheckFlowTest
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_unknownCommand_v12() throws Exception {
|
||||
thrown.expect(UnknownFeeCommandException.class);
|
||||
setEppInput("domain_check_fee_unknown_command_v12.xml");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_invalidCommand_v06() throws Exception {
|
||||
thrown.expect(UnknownFeeCommandException.class);
|
||||
|
@ -679,6 +762,13 @@ public class DomainCheckFlowTest
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_invalidCommand_v12() throws Exception {
|
||||
thrown.expect(UnknownFeeCommandException.class);
|
||||
setEppInput("domain_check_fee_invalid_command_v12.xml");
|
||||
runFlow();
|
||||
}
|
||||
|
||||
private void runEapFeeCheckTest(String inputFile, String outputFile) throws Exception {
|
||||
clock.setTo(DateTime.parse("2010-01-01T10:00:00Z"));
|
||||
persistActiveDomain("example1.tld");
|
||||
|
@ -701,5 +791,9 @@ public class DomainCheckFlowTest
|
|||
public void testSuccess_eapFeeCheck_v11() throws Exception {
|
||||
runEapFeeCheckTest("domain_check_fee_v11.xml", "domain_check_eap_fee_response_v11.xml");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_eapFeeCheck_v12() throws Exception {
|
||||
runEapFeeCheckTest("domain_check_fee_v12.xml", "domain_check_eap_fee_response_v12.xml");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue