mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Add the ability to require premium fee acking for a registrar
When enabled for a registrar, all EPP operations on premium domains that have costs (e.g. creates, renews, transfers) will fail unless the EPP fee extension is used to explicitly ack the amount of fee as part of the EPP transaction. This ack is required regardless of whether premium fee acking is required at the registry level. No data migration is necessary since false is the desired default for this new attribute. This CL also contains some slight refactoring of static utility methods used to perform fee verification; there was short-circuiting at call-sites in two places when what was really needed was two methods, one implementing additional functionality on top of the other, and calling the inner method in the places where short-circuiting had previously been necessary. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=184229363
This commit is contained in:
parent
6bcd40f18a
commit
98a61b8181
20 changed files with 264 additions and 119 deletions
|
@ -1453,8 +1453,33 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_feeNotProvidedOnPremiumName() throws Exception {
|
||||
public void testFailure_premiumNotAcked_byRegistryRequiringAcking() throws Exception {
|
||||
createTld("example");
|
||||
assertThat(Registry.get("example").getPremiumPriceAckRequired()).isTrue();
|
||||
setEppInput("domain_create_premium.xml");
|
||||
persistContactsAndHosts("net");
|
||||
EppException thrown = expectThrows(FeesRequiredForPremiumNameException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_premiumNotAcked_byRegistrarRequiringAcking() throws Exception {
|
||||
createTld("example");
|
||||
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build());
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar").asBuilder().setPremiumPriceAckRequired(true).build());
|
||||
setEppInput("domain_create_premium.xml");
|
||||
persistContactsAndHosts("net");
|
||||
EppException thrown = expectThrows(FeesRequiredForPremiumNameException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_premiumNotAcked_whenRegistrarAndRegistryRequireAcking() throws Exception {
|
||||
createTld("example");
|
||||
persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(true).build());
|
||||
persistResource(
|
||||
loadRegistrar("TheRegistrar").asBuilder().setPremiumPriceAckRequired(true).build());
|
||||
setEppInput("domain_create_premium.xml");
|
||||
persistContactsAndHosts("net");
|
||||
EppException thrown = expectThrows(FeesRequiredForPremiumNameException.class, this::runFlow);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue