mirror of
https://github.com/google/nomulus.git
synced 2025-07-22 18:55:58 +02:00
Bypass EAP fees for anchor tenants
Note that the check flow does not yet handle any kind of allocation token handling at all. Step 2 will be to add allocation token handling there, so a RESERVED_FOR_ANCHOR_TENANT or RESERVED_FOR_SPECIFIC_USE domain will show as available instead of reserved if the right token is specified using the extension. Then once that's done, we can use that information to adjust the price accordingly as well. Right now the behavior with a domain check is that reserved domains always show as reserved, even if they're anchor tenants. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=215599350
This commit is contained in:
parent
ce5bbe4bfa
commit
1586813398
6 changed files with 55 additions and 136 deletions
|
@ -391,7 +391,8 @@ public class DomainAllocateFlow implements TransactionalFlow {
|
||||||
|
|
||||||
private ImmutableList<FeeTransformResponseExtension> createResponseExtensions(
|
private ImmutableList<FeeTransformResponseExtension> createResponseExtensions(
|
||||||
DateTime now, Registry registry, int years) throws EppException {
|
DateTime now, Registry registry, int years) throws EppException {
|
||||||
FeesAndCredits feesAndCredits = pricingLogic.getCreatePrice(registry, targetId, now, years);
|
FeesAndCredits feesAndCredits =
|
||||||
|
pricingLogic.getCreatePrice(registry, targetId, now, years, false);
|
||||||
Optional<FeeCreateCommandExtension> feeCreate =
|
Optional<FeeCreateCommandExtension> feeCreate =
|
||||||
eppInput.getSingleExtension(FeeCreateCommandExtension.class);
|
eppInput.getSingleExtension(FeeCreateCommandExtension.class);
|
||||||
return feeCreate.isPresent()
|
return feeCreate.isPresent()
|
||||||
|
|
|
@ -211,8 +211,11 @@ public final class DomainApplicationCreateFlow implements TransactionalFlow {
|
||||||
checkAllowedAccessToTld(clientId, tld);
|
checkAllowedAccessToTld(clientId, tld);
|
||||||
}
|
}
|
||||||
Registry registry = Registry.get(tld);
|
Registry registry = Registry.get(tld);
|
||||||
|
boolean isAnchorTenant =
|
||||||
|
isAnchorTenant(domainName, Optional.empty(), authInfo.getPw().getValue(), Optional.empty());
|
||||||
FeesAndCredits feesAndCredits =
|
FeesAndCredits feesAndCredits =
|
||||||
pricingLogic.getCreatePrice(registry, targetId, now, command.getPeriod().getValue());
|
pricingLogic.getCreatePrice(
|
||||||
|
registry, targetId, now, command.getPeriod().getValue(), isAnchorTenant);
|
||||||
verifyUnitIsYears(command.getPeriod());
|
verifyUnitIsYears(command.getPeriod());
|
||||||
int years = command.getPeriod().getValue();
|
int years = command.getPeriod().getValue();
|
||||||
validateRegistrationPeriod(years);
|
validateRegistrationPeriod(years);
|
||||||
|
@ -220,8 +223,6 @@ public final class DomainApplicationCreateFlow implements TransactionalFlow {
|
||||||
LaunchCreateExtension launchCreate =
|
LaunchCreateExtension launchCreate =
|
||||||
eppInput.getSingleExtension(LaunchCreateExtension.class).get();
|
eppInput.getSingleExtension(LaunchCreateExtension.class).get();
|
||||||
validateLaunchCreateExtension(launchCreate, registry, domainName, now);
|
validateLaunchCreateExtension(launchCreate, registry, domainName, now);
|
||||||
boolean isAnchorTenant =
|
|
||||||
isAnchorTenant(domainName, Optional.empty(), authInfo.getPw().getValue(), Optional.empty());
|
|
||||||
// Superusers can create reserved domains, force creations on domains that require a claims
|
// Superusers can create reserved domains, force creations on domains that require a claims
|
||||||
// notice without specifying a claims key, and override blocks on registering premium domains.
|
// notice without specifying a claims key, and override blocks on registering premium domains.
|
||||||
if (!isSuperuser) {
|
if (!isSuperuser) {
|
||||||
|
|
|
@ -308,7 +308,8 @@ public class DomainCreateFlow implements TransactionalFlow {
|
||||||
.build());
|
.build());
|
||||||
Optional<FeeCreateCommandExtension> feeCreate =
|
Optional<FeeCreateCommandExtension> feeCreate =
|
||||||
eppInput.getSingleExtension(FeeCreateCommandExtension.class);
|
eppInput.getSingleExtension(FeeCreateCommandExtension.class);
|
||||||
FeesAndCredits feesAndCredits = pricingLogic.getCreatePrice(registry, targetId, now, years);
|
FeesAndCredits feesAndCredits =
|
||||||
|
pricingLogic.getCreatePrice(registry, targetId, now, years, isAnchorTenant);
|
||||||
validateFeeChallenge(targetId, registry.getTldStr(), clientId, now, feeCreate, feesAndCredits);
|
validateFeeChallenge(targetId, registry.getTldStr(), clientId, now, feeCreate, feesAndCredits);
|
||||||
Optional<SecDnsCreateExtension> secDnsCreate =
|
Optional<SecDnsCreateExtension> secDnsCreate =
|
||||||
validateSecDnsExtension(eppInput.getSingleExtension(SecDnsCreateExtension.class));
|
validateSecDnsExtension(eppInput.getSingleExtension(SecDnsCreateExtension.class));
|
||||||
|
|
|
@ -621,7 +621,10 @@ public class DomainFlowUtils {
|
||||||
builder.setReasonIfSupported("reserved");
|
builder.setReasonIfSupported("reserved");
|
||||||
} else {
|
} else {
|
||||||
builder.setAvailIfSupported(true);
|
builder.setAvailIfSupported(true);
|
||||||
fees = pricingLogic.getCreatePrice(registry, domainNameString, now, years).getFees();
|
// TODO(b/117145844): Once allocation token support for domain check flow is implemented,
|
||||||
|
// we should be able to calculate the correct price here.
|
||||||
|
fees =
|
||||||
|
pricingLogic.getCreatePrice(registry, domainNameString, now, years, false).getFees();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RENEW:
|
case RENEW:
|
||||||
|
|
|
@ -54,7 +54,8 @@ public final class DomainPricingLogic {
|
||||||
|
|
||||||
/** Returns a new create price for the pricer. */
|
/** Returns a new create price for the pricer. */
|
||||||
public FeesAndCredits getCreatePrice(
|
public FeesAndCredits getCreatePrice(
|
||||||
Registry registry, String domainName, DateTime date, int years) throws EppException {
|
Registry registry, String domainName, DateTime date, int years, boolean isAnchorTenant)
|
||||||
|
throws EppException {
|
||||||
CurrencyUnit currency = registry.getCurrency();
|
CurrencyUnit currency = registry.getCurrency();
|
||||||
|
|
||||||
// Get the vanilla create cost.
|
// Get the vanilla create cost.
|
||||||
|
@ -65,7 +66,8 @@ public final class DomainPricingLogic {
|
||||||
Fee eapFee = registry.getEapFeeFor(date);
|
Fee eapFee = registry.getEapFeeFor(date);
|
||||||
FeesAndCredits.Builder feesBuilder =
|
FeesAndCredits.Builder feesBuilder =
|
||||||
new FeesAndCredits.Builder().setCurrency(currency).addFeeOrCredit(createFeeOrCredit);
|
new FeesAndCredits.Builder().setCurrency(currency).addFeeOrCredit(createFeeOrCredit);
|
||||||
if (!eapFee.hasZeroCost()) {
|
// Don't charge anchor tenants EAP fees.
|
||||||
|
if (!isAnchorTenant && !eapFee.hasZeroCost()) {
|
||||||
feesBuilder.addFeeOrCredit(eapFee);
|
feesBuilder.addFeeOrCredit(eapFee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -270,7 +270,8 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
new ImmutableSet.Builder<BillingEvent>().add(createBillingEvent).add(renewBillingEvent);
|
new ImmutableSet.Builder<BillingEvent>().add(createBillingEvent).add(renewBillingEvent);
|
||||||
|
|
||||||
// If EAP is applied, a billing event for EAP should be present.
|
// If EAP is applied, a billing event for EAP should be present.
|
||||||
if (!eapFee.isZero()) {
|
// EAP fees are bypassed for anchor tenant domains.
|
||||||
|
if (!isAnchorTenant && !eapFee.isZero()) {
|
||||||
BillingEvent.OneTime eapBillingEvent =
|
BillingEvent.OneTime eapBillingEvent =
|
||||||
new BillingEvent.OneTime.Builder()
|
new BillingEvent.OneTime.Builder()
|
||||||
.setReason(Reason.FEE_EARLY_ACCESS)
|
.setReason(Reason.FEE_EARLY_ACCESS)
|
||||||
|
@ -1012,6 +1013,22 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
.isEqualTo(Key.create(getHistoryEntries(reloadResourceByForeignKey()).get(0)));
|
.isEqualTo(Key.create(getHistoryEntries(reloadResourceByForeignKey()).get(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSuccess_anchorTenant_bypassesEapFees() throws Exception {
|
||||||
|
setEapForTld("tld");
|
||||||
|
// This XML file does not contain EAP fees.
|
||||||
|
setEppInput("domain_create_anchor_allocationtoken.xml");
|
||||||
|
persistContactsAndHosts();
|
||||||
|
runFlowAssertResponse(loadFile("domain_create_anchor_response.xml"));
|
||||||
|
assertSuccessfulCreate("tld", ImmutableSet.of(ANCHOR_TENANT));
|
||||||
|
assertNoLordn();
|
||||||
|
AllocationToken reloadedToken =
|
||||||
|
ofy().load().key(Key.create(AllocationToken.class, "abcDEF23456")).now();
|
||||||
|
assertThat(reloadedToken.isRedeemed()).isTrue();
|
||||||
|
assertThat(reloadedToken.getRedemptionHistoryEntry())
|
||||||
|
.isEqualTo(Key.create(getHistoryEntries(reloadResourceByForeignKey()).get(0)));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSuccess_anchorTenant_viaAuthCode_withClaims() throws Exception {
|
public void testSuccess_anchorTenant_viaAuthCode_withClaims() throws Exception {
|
||||||
persistResource(
|
persistResource(
|
||||||
|
@ -2242,18 +2259,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
public void testFailure_eapFee_combined() {
|
public void testFailure_eapFee_combined() {
|
||||||
setEppInput("domain_create_eap_combined_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
|
setEppInput("domain_create_eap_combined_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
EppException thrown = assertThrows(FeeDescriptionParseException.class, this::runFlow);
|
EppException thrown = assertThrows(FeeDescriptionParseException.class, this::runFlow);
|
||||||
assertThat(thrown).hasMessageThat().contains("No fee description");
|
assertThat(thrown).hasMessageThat().contains("No fee description");
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
@ -2271,18 +2277,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
"DESCRIPTION_2",
|
"DESCRIPTION_2",
|
||||||
"create"));
|
"create"));
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
EppException thrown = assertThrows(FeesMismatchException.class, this::runFlow);
|
EppException thrown = assertThrows(FeesMismatchException.class, this::runFlow);
|
||||||
assertThat(thrown).hasMessageThat().contains("CREATE");
|
assertThat(thrown).hasMessageThat().contains("CREATE");
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
@ -2302,18 +2297,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
.put("FEE_3", "55")
|
.put("FEE_3", "55")
|
||||||
.build());
|
.build());
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
EppException thrown = assertThrows(FeesMismatchException.class, this::runFlow);
|
EppException thrown = assertThrows(FeesMismatchException.class, this::runFlow);
|
||||||
assertThat(thrown).hasMessageThat().contains("expected total of USD 126.00");
|
assertThat(thrown).hasMessageThat().contains("expected total of USD 126.00");
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
@ -2333,18 +2317,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
.put("FEE_3", "55")
|
.put("FEE_3", "55")
|
||||||
.build());
|
.build());
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
EppException thrown = assertThrows(FeesMismatchException.class, this::runFlow);
|
EppException thrown = assertThrows(FeesMismatchException.class, this::runFlow);
|
||||||
assertThat(thrown).hasMessageThat().contains("expected fee of USD 100.00");
|
assertThat(thrown).hasMessageThat().contains("expected fee of USD 100.00");
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
@ -2364,18 +2337,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
.put("FEE_3", "45")
|
.put("FEE_3", "45")
|
||||||
.build());
|
.build());
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
doSuccessfulTest(
|
doSuccessfulTest(
|
||||||
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
|
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
|
||||||
}
|
}
|
||||||
|
@ -2392,18 +2354,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
"DESCRIPTION_2",
|
"DESCRIPTION_2",
|
||||||
"Early Access Period, fee expires: 2022-03-01T00:00:00.000Z"));
|
"Early Access Period, fee expires: 2022-03-01T00:00:00.000Z"));
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
doSuccessfulTest(
|
doSuccessfulTest(
|
||||||
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
|
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
|
||||||
}
|
}
|
||||||
|
@ -2415,18 +2366,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
ImmutableMap.of(
|
ImmutableMap.of(
|
||||||
"FEE_VERSION", "0.6", "DESCRIPTION_1", "create", "DESCRIPTION_2", "renew transfer"));
|
"FEE_VERSION", "0.6", "DESCRIPTION_1", "create", "DESCRIPTION_2", "renew transfer"));
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
EppException thrown = assertThrows(FeeDescriptionMultipleMatchesException.class, this::runFlow);
|
EppException thrown = assertThrows(FeeDescriptionMultipleMatchesException.class, this::runFlow);
|
||||||
assertThat(thrown).hasMessageThat().contains("RENEW, TRANSFER");
|
assertThat(thrown).hasMessageThat().contains("RENEW, TRANSFER");
|
||||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||||
|
@ -2444,18 +2384,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
"DESCRIPTION_2",
|
"DESCRIPTION_2",
|
||||||
"Early Access Period"));
|
"Early Access Period"));
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
doSuccessfulTest(
|
doSuccessfulTest(
|
||||||
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
|
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.6"));
|
||||||
}
|
}
|
||||||
|
@ -2472,18 +2401,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
"DESCRIPTION_2",
|
"DESCRIPTION_2",
|
||||||
"Early Access Period"));
|
"Early Access Period"));
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
doSuccessfulTest(
|
doSuccessfulTest(
|
||||||
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
|
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.11"));
|
||||||
}
|
}
|
||||||
|
@ -2500,18 +2418,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
"DESCRIPTION_2",
|
"DESCRIPTION_2",
|
||||||
"Early Access Period"));
|
"Early Access Period"));
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
persistResource(
|
setEapForTld("tld");
|
||||||
Registry.get("tld")
|
|
||||||
.asBuilder()
|
|
||||||
.setEapFeeSchedule(
|
|
||||||
ImmutableSortedMap.of(
|
|
||||||
START_OF_TIME,
|
|
||||||
Money.of(USD, 0),
|
|
||||||
clock.nowUtc().minusDays(1),
|
|
||||||
Money.of(USD, 100),
|
|
||||||
clock.nowUtc().plusDays(1),
|
|
||||||
Money.of(USD, 0)))
|
|
||||||
.build());
|
|
||||||
doSuccessfulTest(
|
doSuccessfulTest(
|
||||||
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
|
"tld", "domain_create_response_eap_fee.xml", ImmutableMap.of("FEE_VERSION", "0.12"));
|
||||||
}
|
}
|
||||||
|
@ -2519,8 +2426,18 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
@Test
|
@Test
|
||||||
public void testFailure_domainInEap_failsWithoutFeeExtension() {
|
public void testFailure_domainInEap_failsWithoutFeeExtension() {
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
|
setEapForTld("tld");
|
||||||
|
Exception e = assertThrows(FeesRequiredDuringEarlyAccessProgramException.class, this::runFlow);
|
||||||
|
assertThat(e)
|
||||||
|
.hasMessageThat()
|
||||||
|
.isEqualTo(
|
||||||
|
"Fees must be explicitly acknowledged when creating domains "
|
||||||
|
+ "during the Early Access Program. The EAP fee is: USD 100.00");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setEapForTld(String tld) {
|
||||||
persistResource(
|
persistResource(
|
||||||
Registry.get("tld")
|
Registry.get(tld)
|
||||||
.asBuilder()
|
.asBuilder()
|
||||||
.setEapFeeSchedule(
|
.setEapFeeSchedule(
|
||||||
ImmutableSortedMap.of(
|
ImmutableSortedMap.of(
|
||||||
|
@ -2531,12 +2448,6 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
||||||
clock.nowUtc().plusDays(1),
|
clock.nowUtc().plusDays(1),
|
||||||
Money.of(USD, 0)))
|
Money.of(USD, 0)))
|
||||||
.build());
|
.build());
|
||||||
Exception e = assertThrows(FeesRequiredDuringEarlyAccessProgramException.class, this::runFlow);
|
|
||||||
assertThat(e)
|
|
||||||
.hasMessageThat()
|
|
||||||
.isEqualTo(
|
|
||||||
"Fees must be explicitly acknowledged when creating domains "
|
|
||||||
+ "during the Early Access Program. The EAP fee is: USD 100.00");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue