mirror of
https://github.com/google/nomulus.git
synced 2025-07-07 03:33:28 +02:00
Create a separate per-tld registry lock/unlock cost (#800)
* Create a separate per-tld registry lock/unlock cost Currently we use the standard server status change cost for this, but this might not be ideal at some point in the future if we wish to allow manual forced updates outside of the standard registry lock system (we would charge for these manual forced updates, even if we don't charge for registry locks). * Remove period
This commit is contained in:
parent
054571a625
commit
1a63d50b82
10 changed files with 56 additions and 9 deletions
|
@ -597,6 +597,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBa
|
|||
.setRestoreBillingCost(Money.of(EUR, 11))
|
||||
.setRenewBillingCostTransitions(ImmutableSortedMap.of(START_OF_TIME, Money.of(EUR, 7)))
|
||||
.setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(EUR)))
|
||||
.setRegistryLockOrUnlockBillingCost(Money.of(EUR, 20))
|
||||
.setServerStatusChangeBillingCost(Money.of(EUR, 19))
|
||||
.build());
|
||||
persistDomain();
|
||||
|
@ -615,6 +616,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBa
|
|||
.setRestoreBillingCost(Money.of(EUR, 11))
|
||||
.setRenewBillingCostTransitions(ImmutableSortedMap.of(START_OF_TIME, Money.of(EUR, 7)))
|
||||
.setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(EUR)))
|
||||
.setRegistryLockOrUnlockBillingCost(Money.of(EUR, 20))
|
||||
.setServerStatusChangeBillingCost(Money.of(EUR, 19))
|
||||
.build());
|
||||
persistDomain();
|
||||
|
@ -633,6 +635,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBa
|
|||
.setRestoreBillingCost(Money.of(EUR, 11))
|
||||
.setRenewBillingCostTransitions(ImmutableSortedMap.of(START_OF_TIME, Money.of(EUR, 7)))
|
||||
.setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(EUR)))
|
||||
.setRegistryLockOrUnlockBillingCost(Money.of(EUR, 20))
|
||||
.setServerStatusChangeBillingCost(Money.of(EUR, 19))
|
||||
.build());
|
||||
persistDomain();
|
||||
|
|
|
@ -533,6 +533,7 @@ class DomainRestoreRequestFlowTest
|
|||
.setRenewBillingCostTransitions(ImmutableSortedMap.of(START_OF_TIME, Money.of(EUR, 7)))
|
||||
.setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(EUR)))
|
||||
.setServerStatusChangeBillingCost(Money.of(EUR, 19))
|
||||
.setRegistryLockOrUnlockBillingCost(Money.of(EUR, 0))
|
||||
.build());
|
||||
EppException thrown = assertThrows(CurrencyUnitMismatchException.class, this::runFlow);
|
||||
assertAboutEppExceptions().that(thrown).marshalsToXml();
|
||||
|
|
|
@ -69,6 +69,8 @@ class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
assertThat(registry.getRedemptionGracePeriodLength())
|
||||
.isEqualTo(Registry.DEFAULT_REDEMPTION_GRACE_PERIOD);
|
||||
assertThat(registry.getPendingDeleteLength()).isEqualTo(Registry.DEFAULT_PENDING_DELETE_LENGTH);
|
||||
assertThat(registry.getRegistryLockOrUnlockBillingCost())
|
||||
.isEqualTo(Registry.DEFAULT_REGISTRY_LOCK_OR_UNLOCK_BILLING_COST);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -230,6 +232,17 @@ class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
.isEqualTo(Money.of(USD, 42.42));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_registryLockOrUnlockCostFlag() throws Exception {
|
||||
runCommandForced(
|
||||
"--registry_lock_or_unlock_cost=\"USD 42.42\"",
|
||||
"--roid_suffix=Q9JYB4C",
|
||||
"--dns_writers=VoidDnsWriter",
|
||||
"xn--q9jyb4c");
|
||||
assertThat(Registry.get("xn--q9jyb4c").getRegistryLockOrUnlockBillingCost())
|
||||
.isEqualTo(Money.of(USD, 42.42));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_nonUsdBillingCostFlag() throws Exception {
|
||||
runCommandForced(
|
||||
|
@ -237,6 +250,7 @@ class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
"--restore_billing_cost=\"JPY 67890\"",
|
||||
"--initial_renew_billing_cost=\"JPY 101112\"",
|
||||
"--server_status_change_cost=\"JPY 97865\"",
|
||||
"--registry_lock_or_unlock_cost=\"JPY 9001\"",
|
||||
"--roid_suffix=Q9JYB4C",
|
||||
"--dns_writers=VoidDnsWriter",
|
||||
"xn--q9jyb4c");
|
||||
|
|
|
@ -528,7 +528,7 @@ public final class DomainLockUtilsTest {
|
|||
.setReason(Reason.SERVER_STATUS)
|
||||
.setTargetId(domain.getForeignKey())
|
||||
.setClientId(domain.getCurrentSponsorClientId())
|
||||
.setCost(Registry.get(domain.getTld()).getServerStatusChangeCost())
|
||||
.setCost(Registry.get(domain.getTld()).getRegistryLockOrUnlockBillingCost())
|
||||
.setEventTime(clock.nowUtc())
|
||||
.setBillingTime(clock.nowUtc())
|
||||
.setParent(entry)
|
||||
|
|
|
@ -212,19 +212,21 @@ class UpdateTldCommandTest extends CommandTestCase<UpdateTldCommand> {
|
|||
ImmutableSortedMap.of(START_OF_TIME, Money.ofMajor(JPY, 1)))
|
||||
.setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(JPY)))
|
||||
.setServerStatusChangeBillingCost(Money.ofMajor(JPY, 1))
|
||||
.setRegistryLockOrUnlockBillingCost(Money.ofMajor(JPY, 1))
|
||||
.build());
|
||||
runCommandForced(
|
||||
"--create_billing_cost=\"JPY 12345\"",
|
||||
"--restore_billing_cost=\"JPY 67890\"",
|
||||
"--renew_billing_cost_transitions=\"0=JPY 101112\"",
|
||||
"--server_status_change_cost=\"JPY 97865\"",
|
||||
"--registry_lock_or_unlock_cost=\"JPY 9001\"",
|
||||
"xn--q9jyb4c");
|
||||
assertThat(Registry.get("xn--q9jyb4c").getStandardCreateCost())
|
||||
.isEqualTo(Money.ofMajor(JPY, 12345));
|
||||
assertThat(Registry.get("xn--q9jyb4c").getStandardRestoreCost())
|
||||
.isEqualTo(Money.ofMajor(JPY, 67890));
|
||||
assertThat(Registry.get("xn--q9jyb4c").getStandardRenewCost(START_OF_TIME))
|
||||
.isEqualTo(Money.ofMajor(JPY, 101112));
|
||||
Registry registry = Registry.get("xn--q9jyb4c");
|
||||
assertThat(registry.getStandardCreateCost()).isEqualTo(Money.ofMajor(JPY, 12345));
|
||||
assertThat(registry.getStandardRestoreCost()).isEqualTo(Money.ofMajor(JPY, 67890));
|
||||
assertThat(registry.getStandardRenewCost(START_OF_TIME)).isEqualTo(Money.ofMajor(JPY, 101112));
|
||||
assertThat(registry.getServerStatusChangeCost()).isEqualTo(Money.ofMajor(JPY, 97865));
|
||||
assertThat(registry.getRegistryLockOrUnlockBillingCost()).isEqualTo(Money.ofMajor(JPY, 9001));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -317,7 +317,7 @@ final class RegistryLockVerifyActionTest {
|
|||
.setReason(Reason.SERVER_STATUS)
|
||||
.setTargetId(domain.getForeignKey())
|
||||
.setClientId(domain.getCurrentSponsorClientId())
|
||||
.setCost(Registry.get(domain.getTld()).getServerStatusChangeCost())
|
||||
.setCost(Registry.get(domain.getTld()).getRegistryLockOrUnlockBillingCost())
|
||||
.setEventTime(fakeClock.nowUtc())
|
||||
.setBillingTime(fakeClock.nowUtc())
|
||||
.setParent(historyEntry)
|
||||
|
|
|
@ -640,6 +640,7 @@ class google.registry.model.registry.Registry {
|
|||
java.util.Set<java.lang.String> dnsWriters;
|
||||
org.joda.money.CurrencyUnit currency;
|
||||
org.joda.money.Money createBillingCost;
|
||||
org.joda.money.Money registryLockOrUnlockBillingCost;
|
||||
org.joda.money.Money restoreBillingCost;
|
||||
org.joda.money.Money serverStatusChangeBillingCost;
|
||||
org.joda.time.DateTime claimsPeriodEnd;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue