mirror of
https://github.com/google/nomulus
synced 2026-09-20 15:04:24 +00:00
Add a renewal cost for ATs when renewal is SPECIFIED (#2484)
Note: this is not used yet
This commit is contained in:
@@ -50,6 +50,7 @@ import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName
|
|||||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.persistence.WithVKey;
|
import google.registry.persistence.WithVKey;
|
||||||
|
import google.registry.persistence.converter.JodaMoneyType;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -63,6 +64,9 @@ import javax.persistence.Enumerated;
|
|||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Index;
|
import javax.persistence.Index;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import org.hibernate.annotations.Columns;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
/** An entity representing an allocation token. */
|
/** An entity representing an allocation token. */
|
||||||
@@ -236,6 +240,12 @@ public class AllocationToken extends UpdateAutoTimestampEntity implements Builda
|
|||||||
@Column(name = "renewalPriceBehavior", nullable = false)
|
@Column(name = "renewalPriceBehavior", nullable = false)
|
||||||
RenewalPriceBehavior renewalPriceBehavior = RenewalPriceBehavior.DEFAULT;
|
RenewalPriceBehavior renewalPriceBehavior = RenewalPriceBehavior.DEFAULT;
|
||||||
|
|
||||||
|
/** The price used for renewals iff the renewalPriceBehavior is SPECIFIED. */
|
||||||
|
@Nullable
|
||||||
|
@Type(type = JodaMoneyType.TYPE_NAME)
|
||||||
|
@Columns(columns = {@Column(name = "renewalPriceAmount"), @Column(name = "renewalPriceCurrency")})
|
||||||
|
Money renewalPrice;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
RegistrationBehavior registrationBehavior = RegistrationBehavior.DEFAULT;
|
RegistrationBehavior registrationBehavior = RegistrationBehavior.DEFAULT;
|
||||||
@@ -310,6 +320,10 @@ public class AllocationToken extends UpdateAutoTimestampEntity implements Builda
|
|||||||
return renewalPriceBehavior;
|
return renewalPriceBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Optional<Money> getRenewalPrice() {
|
||||||
|
return Optional.ofNullable(renewalPrice);
|
||||||
|
}
|
||||||
|
|
||||||
public RegistrationBehavior getRegistrationBehavior() {
|
public RegistrationBehavior getRegistrationBehavior() {
|
||||||
return registrationBehavior;
|
return registrationBehavior;
|
||||||
}
|
}
|
||||||
@@ -377,29 +391,12 @@ public class AllocationToken extends UpdateAutoTimestampEntity implements Builda
|
|||||||
public AllocationToken build() {
|
public AllocationToken build() {
|
||||||
checkArgumentNotNull(getInstance().tokenType, "Token type must be specified");
|
checkArgumentNotNull(getInstance().tokenType, "Token type must be specified");
|
||||||
checkArgument(!Strings.isNullOrEmpty(getInstance().token), "Token must not be null or empty");
|
checkArgument(!Strings.isNullOrEmpty(getInstance().token), "Token must not be null or empty");
|
||||||
checkArgument(
|
|
||||||
!getInstance().tokenType.equals(TokenType.BULK_PRICING)
|
|
||||||
|| getInstance().renewalPriceBehavior.equals(RenewalPriceBehavior.SPECIFIED),
|
|
||||||
"Bulk tokens must have renewalPriceBehavior set to SPECIFIED");
|
|
||||||
checkArgument(
|
|
||||||
!getInstance().tokenType.equals(TokenType.BULK_PRICING)
|
|
||||||
|| ImmutableSet.of(CommandName.CREATE).equals(getInstance().allowedEppActions),
|
|
||||||
"Bulk tokens may only be valid for CREATE actions");
|
|
||||||
checkArgument(
|
|
||||||
!getInstance().tokenType.equals(TokenType.BULK_PRICING)
|
|
||||||
|| !getInstance().discountPremiums,
|
|
||||||
"Bulk tokens cannot discount premium names");
|
|
||||||
checkArgument(
|
checkArgument(
|
||||||
getInstance().domainName == null || getInstance().tokenType.isOneTimeUse(),
|
getInstance().domainName == null || getInstance().tokenType.isOneTimeUse(),
|
||||||
"Domain name can only be specified for SINGLE_USE or REGISTER_BSA tokens");
|
"Domain name can only be specified for SINGLE_USE or REGISTER_BSA tokens");
|
||||||
checkArgument(
|
checkArgument(
|
||||||
getInstance().redemptionHistoryId == null || getInstance().tokenType.isOneTimeUse(),
|
getInstance().redemptionHistoryId == null || getInstance().tokenType.isOneTimeUse(),
|
||||||
"Redemption history entry can only be specified for SINGLE_USE or REGISTER_BSA tokens");
|
"Redemption history entry can only be specified for SINGLE_USE or REGISTER_BSA tokens");
|
||||||
checkArgument(
|
|
||||||
getInstance().tokenType != TokenType.BULK_PRICING
|
|
||||||
|| (getInstance().allowedClientIds != null
|
|
||||||
&& getInstance().allowedClientIds.size() == 1),
|
|
||||||
"BULK_PRICING tokens must have exactly one allowed client registrar");
|
|
||||||
checkArgument(
|
checkArgument(
|
||||||
getInstance().discountFraction > 0 || !getInstance().discountPremiums,
|
getInstance().discountFraction > 0 || !getInstance().discountPremiums,
|
||||||
"Discount premiums can only be specified along with a discount fraction");
|
"Discount premiums can only be specified along with a discount fraction");
|
||||||
@@ -425,6 +422,33 @@ public class AllocationToken extends UpdateAutoTimestampEntity implements Builda
|
|||||||
|| getInstance().allowedEppActions.contains(CommandName.CREATE),
|
|| getInstance().allowedEppActions.contains(CommandName.CREATE),
|
||||||
"NONPREMIUM_CREATE tokens must allow for CREATE actions");
|
"NONPREMIUM_CREATE tokens must allow for CREATE actions");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkArgument(
|
||||||
|
getInstance().renewalPriceBehavior.equals(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
== (getInstance().renewalPrice != null),
|
||||||
|
"renewalPrice must be specified iff renewalPriceBehavior is SPECIFIED");
|
||||||
|
|
||||||
|
if (getInstance().tokenType.equals(TokenType.BULK_PRICING)) {
|
||||||
|
checkArgument(
|
||||||
|
getInstance().discountFraction == 1.0,
|
||||||
|
"BULK_PRICING tokens must have a discountFraction of 1.0");
|
||||||
|
checkArgument(
|
||||||
|
!getInstance().shouldDiscountPremiums(),
|
||||||
|
"BULK_PRICING tokens cannot discount premium names");
|
||||||
|
checkArgument(
|
||||||
|
getInstance().renewalPriceBehavior.equals(RenewalPriceBehavior.SPECIFIED),
|
||||||
|
"BULK_PRICING tokens must have renewalPriceBehavior set to SPECIFIED");
|
||||||
|
checkArgument(
|
||||||
|
getInstance().renewalPrice.getAmount().intValue() == 0,
|
||||||
|
"BULK_PRICING tokens must have a renewal price of 0");
|
||||||
|
checkArgument(
|
||||||
|
ImmutableSet.of(CommandName.CREATE).equals(getInstance().allowedEppActions),
|
||||||
|
"BULK_PRICING tokens may only be valid for CREATE actions");
|
||||||
|
checkArgument(
|
||||||
|
getInstance().allowedClientIds != null && getInstance().allowedClientIds.size() == 1,
|
||||||
|
"BULK_PRICING tokens must have exactly one allowed client registrar");
|
||||||
|
}
|
||||||
|
|
||||||
if (getInstance().domainName != null) {
|
if (getInstance().domainName != null) {
|
||||||
try {
|
try {
|
||||||
DomainFlowUtils.validateDomainName(getInstance().domainName);
|
DomainFlowUtils.validateDomainName(getInstance().domainName);
|
||||||
@@ -521,6 +545,11 @@ public class AllocationToken extends UpdateAutoTimestampEntity implements Builda
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Builder setRenewalPrice(Money renewalPrice) {
|
||||||
|
getInstance().renewalPrice = renewalPrice;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Builder setRegistrationBehavior(RegistrationBehavior registrationBehavior) {
|
public Builder setRegistrationBehavior(RegistrationBehavior registrationBehavior) {
|
||||||
getInstance().registrationBehavior = registrationBehavior;
|
getInstance().registrationBehavior = registrationBehavior;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
|||||||
|
|
||||||
import com.beust.jcommander.Parameter;
|
import com.beust.jcommander.Parameter;
|
||||||
import com.beust.jcommander.Parameters;
|
import com.beust.jcommander.Parameters;
|
||||||
|
import com.beust.jcommander.internal.Nullable;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Splitter;
|
import com.google.common.base.Splitter;
|
||||||
@@ -62,6 +63,7 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
/** Command to generate and persist {@link AllocationToken}s. */
|
/** Command to generate and persist {@link AllocationToken}s. */
|
||||||
@@ -158,10 +160,16 @@ class GenerateAllocationTokensCommand implements Command {
|
|||||||
"The type of renewal price behavior, either DEFAULT (default), NONPREMIUM, or SPECIFIED."
|
"The type of renewal price behavior, either DEFAULT (default), NONPREMIUM, or SPECIFIED."
|
||||||
+ " This indicates how a domain should be charged for renewal. By default, a domain"
|
+ " This indicates how a domain should be charged for renewal. By default, a domain"
|
||||||
+ " will be renewed at the renewal price from the pricing engine. If the renewal"
|
+ " will be renewed at the renewal price from the pricing engine. If the renewal"
|
||||||
+ " price behavior is set to SPECIFIED, it means that the renewal cost will be the"
|
+ " price behavior is set to SPECIFIED, it means that the renewal cost will be equal"
|
||||||
+ " same as the domain's calculated create price.")
|
+ " to the provided renewal price.")
|
||||||
private RenewalPriceBehavior renewalPriceBehavior = DEFAULT;
|
private RenewalPriceBehavior renewalPriceBehavior = DEFAULT;
|
||||||
|
|
||||||
|
@Parameter(
|
||||||
|
names = {"--renewal_price"},
|
||||||
|
description = "The renewal price amount iff the renewal price behavior is SPECIFIED.")
|
||||||
|
@Nullable
|
||||||
|
private Money renewalPrice;
|
||||||
|
|
||||||
@Parameter(
|
@Parameter(
|
||||||
names = {"--registration_behavior"},
|
names = {"--registration_behavior"},
|
||||||
description =
|
description =
|
||||||
@@ -228,6 +236,7 @@ class GenerateAllocationTokensCommand implements Command {
|
|||||||
Optional.ofNullable(discountYears).ifPresent(token::setDiscountYears);
|
Optional.ofNullable(discountYears).ifPresent(token::setDiscountYears);
|
||||||
Optional.ofNullable(tokenStatusTransitions)
|
Optional.ofNullable(tokenStatusTransitions)
|
||||||
.ifPresent(token::setTokenStatusTransitions);
|
.ifPresent(token::setTokenStatusTransitions);
|
||||||
|
Optional.ofNullable(renewalPrice).ifPresent(token::setRenewalPrice);
|
||||||
Optional.ofNullable(domainNames)
|
Optional.ofNullable(domainNames)
|
||||||
.ifPresent(d -> token.setDomainName(d.removeFirst()));
|
.ifPresent(d -> token.setDomainName(d.removeFirst()));
|
||||||
return token.build();
|
return token.build();
|
||||||
@@ -295,6 +304,10 @@ class GenerateAllocationTokensCommand implements Command {
|
|||||||
+ " map");
|
+ " map");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkArgument(
|
||||||
|
renewalPriceBehavior.equals(RenewalPriceBehavior.SPECIFIED) == (renewalPrice != null),
|
||||||
|
"renewal_price must be specified iff renewal_price_behavior is SPECIFIED");
|
||||||
|
|
||||||
if (tokenStrings != null) {
|
if (tokenStrings != null) {
|
||||||
verifyTokenStringsDoNotExist();
|
verifyTokenStringsDoNotExist();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
|
||||||
/** Command to update existing {@link AllocationToken}s. */
|
/** Command to update existing {@link AllocationToken}s. */
|
||||||
@@ -110,11 +111,17 @@ final class UpdateAllocationTokensCommand extends UpdateOrDeleteAllocationTokens
|
|||||||
"The type of renewal price behavior, either DEFAULT (default), NONPREMIUM, or SPECIFIED."
|
"The type of renewal price behavior, either DEFAULT (default), NONPREMIUM, or SPECIFIED."
|
||||||
+ " This indicates how a domain should be charged for renewal. By default, a domain"
|
+ " This indicates how a domain should be charged for renewal. By default, a domain"
|
||||||
+ " will be renewed at the renewal price from the pricing engine. If the renewal"
|
+ " will be renewed at the renewal price from the pricing engine. If the renewal"
|
||||||
+ " price behavior is set to SPECIFIED, it means that the renewal cost will be the"
|
+ " price behavior is set to SPECIFIED, it means that the renewal cost will be equal"
|
||||||
+ " same as the domain's calculated create price.")
|
+ " to the provided renewal price.")
|
||||||
@Nullable
|
@Nullable
|
||||||
private RenewalPriceBehavior renewalPriceBehavior;
|
private RenewalPriceBehavior renewalPriceBehavior;
|
||||||
|
|
||||||
|
@Parameter(
|
||||||
|
names = {"--renewal_price"},
|
||||||
|
description = "The renewal price amount iff the renewal price behavior is SPECIFIED.")
|
||||||
|
@Nullable
|
||||||
|
private Money renewalPrice;
|
||||||
|
|
||||||
@Parameter(
|
@Parameter(
|
||||||
names = {"--registration_behavior"},
|
names = {"--registration_behavior"},
|
||||||
description =
|
description =
|
||||||
@@ -189,17 +196,22 @@ final class UpdateAllocationTokensCommand extends UpdateOrDeleteAllocationTokens
|
|||||||
.ifPresent(tlds -> builder.setAllowedTlds(ImmutableSet.copyOf(tlds)));
|
.ifPresent(tlds -> builder.setAllowedTlds(ImmutableSet.copyOf(tlds)));
|
||||||
Optional.ofNullable(allowedEppActions)
|
Optional.ofNullable(allowedEppActions)
|
||||||
.ifPresent(
|
.ifPresent(
|
||||||
eppActions -> {
|
eppActions ->
|
||||||
builder.setAllowedEppActions(
|
builder.setAllowedEppActions(
|
||||||
eppActions.stream()
|
eppActions.stream()
|
||||||
.map(CommandName::parseKnownCommand)
|
.map(CommandName::parseKnownCommand)
|
||||||
.collect(toImmutableSet()));
|
.collect(toImmutableSet())));
|
||||||
});
|
|
||||||
Optional.ofNullable(discountFraction).ifPresent(builder::setDiscountFraction);
|
Optional.ofNullable(discountFraction).ifPresent(builder::setDiscountFraction);
|
||||||
Optional.ofNullable(discountPremiums).ifPresent(builder::setDiscountPremiums);
|
Optional.ofNullable(discountPremiums).ifPresent(builder::setDiscountPremiums);
|
||||||
Optional.ofNullable(discountYears).ifPresent(builder::setDiscountYears);
|
Optional.ofNullable(discountYears).ifPresent(builder::setDiscountYears);
|
||||||
Optional.ofNullable(tokenStatusTransitions).ifPresent(builder::setTokenStatusTransitions);
|
Optional.ofNullable(tokenStatusTransitions).ifPresent(builder::setTokenStatusTransitions);
|
||||||
|
|
||||||
|
if (renewalPriceBehavior != null
|
||||||
|
&& renewalPriceBehavior != original.getRenewalPriceBehavior()) {
|
||||||
|
builder.setRenewalPrice(null);
|
||||||
|
}
|
||||||
Optional.ofNullable(renewalPriceBehavior).ifPresent(builder::setRenewalPriceBehavior);
|
Optional.ofNullable(renewalPriceBehavior).ifPresent(builder::setRenewalPriceBehavior);
|
||||||
|
Optional.ofNullable(renewalPrice).ifPresent(builder::setRenewalPrice);
|
||||||
Optional.ofNullable(registrationBehavior).ifPresent(builder::setRegistrationBehavior);
|
Optional.ofNullable(registrationBehavior).ifPresent(builder::setRegistrationBehavior);
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
|||||||
import static google.registry.testing.DatabaseHelper.persistEppResource;
|
import static google.registry.testing.DatabaseHelper.persistEppResource;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
import static google.registry.testing.LogsSubject.assertAboutLogs;
|
import static google.registry.testing.LogsSubject.assertAboutLogs;
|
||||||
|
import static org.joda.money.CurrencyUnit.USD;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.times;
|
import static org.mockito.Mockito.times;
|
||||||
@@ -111,8 +112,9 @@ public class CheckBulkComplianceActionTest {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
bulkPricingPackage =
|
bulkPricingPackage =
|
||||||
new BulkPricingPackage.Builder()
|
new BulkPricingPackage.Builder()
|
||||||
@@ -206,8 +208,9 @@ public class CheckBulkComplianceActionTest {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
BulkPricingPackage bulkPricingPackage2 =
|
BulkPricingPackage bulkPricingPackage2 =
|
||||||
new BulkPricingPackage.Builder()
|
new BulkPricingPackage.Builder()
|
||||||
@@ -263,8 +266,9 @@ public class CheckBulkComplianceActionTest {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
BulkPricingPackage packagePromotion2 =
|
BulkPricingPackage packagePromotion2 =
|
||||||
new BulkPricingPackage.Builder()
|
new BulkPricingPackage.Builder()
|
||||||
@@ -338,8 +342,9 @@ public class CheckBulkComplianceActionTest {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
BulkPricingPackage bulkPricingPackage2 =
|
BulkPricingPackage bulkPricingPackage2 =
|
||||||
new BulkPricingPackage.Builder()
|
new BulkPricingPackage.Builder()
|
||||||
@@ -404,8 +409,9 @@ public class CheckBulkComplianceActionTest {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
BulkPricingPackage bulkPricingPackage2 =
|
BulkPricingPackage bulkPricingPackage2 =
|
||||||
new BulkPricingPackage.Builder()
|
new BulkPricingPackage.Builder()
|
||||||
|
|||||||
@@ -1371,6 +1371,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
|||||||
.setTokenType(SINGLE_USE)
|
.setTokenType(SINGLE_USE)
|
||||||
.setDomainName("resdom.tld")
|
.setDomainName("resdom.tld")
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.build());
|
.build());
|
||||||
// Despite the domain being FULLY_BLOCKED, the non-superuser create succeeds the domain is also
|
// Despite the domain being FULLY_BLOCKED, the non-superuser create succeeds the domain is also
|
||||||
// RESERVED_FOR_SPECIFIC_USE and the correct allocation token is passed.
|
// RESERVED_FOR_SPECIFIC_USE and the correct allocation token is passed.
|
||||||
@@ -3413,6 +3414,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
|||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(SINGLE_USE)
|
.setTokenType(SINGLE_USE)
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.build());
|
.build());
|
||||||
assertThat(
|
assertThat(
|
||||||
DomainCreateFlow.getRenewalPriceInfo(
|
DomainCreateFlow.getRenewalPriceInfo(
|
||||||
@@ -3439,6 +3441,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
|||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(SINGLE_USE)
|
.setTokenType(SINGLE_USE)
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.build())),
|
.build())),
|
||||||
new FeesAndCredits.Builder()
|
new FeesAndCredits.Builder()
|
||||||
.setCurrency(USD)
|
.setCurrency(USD)
|
||||||
@@ -3891,10 +3894,12 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.build());
|
.build());
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
setEppInput(
|
setEppInput(
|
||||||
@@ -3919,10 +3924,12 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.build());
|
.build());
|
||||||
persistContactsAndHosts();
|
persistContactsAndHosts();
|
||||||
setEppInput(
|
setEppInput(
|
||||||
|
|||||||
@@ -1118,8 +1118,9 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("NewRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("NewRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
domain = domain.asBuilder().setCurrentBulkToken(token.createVKey()).build();
|
domain = domain.asBuilder().setCurrentBulkToken(token.createVKey()).build();
|
||||||
persistResource(domain);
|
persistResource(domain);
|
||||||
@@ -1139,8 +1140,9 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("NewRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("NewRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
domain = domain.asBuilder().setCurrentBulkToken(token.createVKey()).build();
|
domain = domain.asBuilder().setCurrentBulkToken(token.createVKey()).build();
|
||||||
persistResource(domain);
|
persistResource(domain);
|
||||||
@@ -1172,8 +1174,9 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Domain> {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("NewRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("NewRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
domain = domain.asBuilder().setCurrentBulkToken(token.createVKey()).build();
|
domain = domain.asBuilder().setCurrentBulkToken(token.createVKey()).build();
|
||||||
persistResource(domain);
|
persistResource(domain);
|
||||||
|
|||||||
@@ -1257,9 +1257,11 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.build());
|
.build());
|
||||||
persistDomain();
|
persistDomain();
|
||||||
@@ -1290,9 +1292,11 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.build());
|
.build());
|
||||||
persistDomain();
|
persistDomain();
|
||||||
@@ -1327,9 +1331,11 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.build());
|
.build());
|
||||||
persistDomain(SPECIFIED, Money.of(USD, 2));
|
persistDomain(SPECIFIED, Money.of(USD, 2));
|
||||||
@@ -1357,9 +1363,11 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setAllowedTlds(ImmutableSet.of("tld"))
|
.setAllowedTlds(ImmutableSet.of("tld"))
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.build());
|
.build());
|
||||||
persistDomain(SPECIFIED, Money.of(USD, 2));
|
persistDomain(SPECIFIED, Money.of(USD, 2));
|
||||||
|
|||||||
@@ -388,7 +388,9 @@ class DomainTransferApproveFlowTest
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.build());
|
.build());
|
||||||
@@ -417,7 +419,9 @@ class DomainTransferApproveFlowTest
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -1339,7 +1339,9 @@ class DomainTransferRequestFlowTest
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.build());
|
.build());
|
||||||
@@ -1398,7 +1400,9 @@ class DomainTransferRequestFlowTest
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.build());
|
.build());
|
||||||
@@ -1456,7 +1460,9 @@ class DomainTransferRequestFlowTest
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ import google.registry.testing.FakeClock;
|
|||||||
import google.registry.util.SerializeUtils;
|
import google.registry.util.SerializeUtils;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import org.joda.money.CurrencyUnit;
|
||||||
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -134,10 +136,12 @@ public class DomainSqlTest {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123Unlimited")
|
.setToken("abc123Unlimited")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setCreationTimeForTest(DateTime.parse("2010-11-12T05:00:00Z"))
|
.setCreationTimeForTest(DateTime.parse("2010-11-12T05:00:00Z"))
|
||||||
.setAllowedTlds(ImmutableSet.of("dev", "app"))
|
.setAllowedTlds(ImmutableSet.of("dev", "app"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setTokenStatusTransitions(
|
.setTokenStatusTransitions(
|
||||||
ImmutableSortedMap.<DateTime, TokenStatus>naturalOrder()
|
ImmutableSortedMap.<DateTime, TokenStatus>naturalOrder()
|
||||||
|
|||||||
@@ -842,7 +842,9 @@ public class DomainTest {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.build());
|
.build());
|
||||||
@@ -904,7 +906,9 @@ public class DomainTest {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.build());
|
.build());
|
||||||
@@ -1074,7 +1078,9 @@ public class DomainTest {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.build();
|
.build();
|
||||||
@@ -1092,7 +1098,9 @@ public class DomainTest {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.build());
|
.build());
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
|||||||
import google.registry.model.domain.token.AllocationToken.TokenType;
|
import google.registry.model.domain.token.AllocationToken.TokenType;
|
||||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||||
import google.registry.util.SerializeUtils;
|
import google.registry.util.SerializeUtils;
|
||||||
|
import org.joda.money.CurrencyUnit;
|
||||||
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -158,15 +160,16 @@ public class AllocationTokenTest extends EntityTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSetRenewalBehavior_assertsRenewalBehaviorIsNotDefault() {
|
void testSetRenewalBehavior_assertsRenewalBehaviorIsNotDefault() {
|
||||||
assertThat(
|
AllocationToken token =
|
||||||
persistResource(
|
persistResource(
|
||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(SINGLE_USE)
|
.setTokenType(SINGLE_USE)
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
.build())
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 5))
|
||||||
.getRenewalPriceBehavior())
|
.build());
|
||||||
.isEqualTo(RenewalPriceBehavior.SPECIFIED);
|
assertThat(token.getRenewalPriceBehavior()).isEqualTo(RenewalPriceBehavior.SPECIFIED);
|
||||||
|
assertThat(token.getRenewalPrice()).hasValue(Money.of(CurrencyUnit.USD, 5));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -181,7 +184,11 @@ public class AllocationTokenTest extends EntityTestCase {
|
|||||||
AllocationToken loadedToken = loadByEntity(token);
|
AllocationToken loadedToken = loadByEntity(token);
|
||||||
assertThat(token).isEqualTo(loadedToken);
|
assertThat(token).isEqualTo(loadedToken);
|
||||||
persistResource(
|
persistResource(
|
||||||
loadedToken.asBuilder().setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED).build());
|
loadedToken
|
||||||
|
.asBuilder()
|
||||||
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 5))
|
||||||
|
.build());
|
||||||
assertThat(loadByEntity(token).getRenewalPriceBehavior())
|
assertThat(loadByEntity(token).getRenewalPriceBehavior())
|
||||||
.isEqualTo(RenewalPriceBehavior.SPECIFIED);
|
.isEqualTo(RenewalPriceBehavior.SPECIFIED);
|
||||||
}
|
}
|
||||||
@@ -218,17 +225,50 @@ public class AllocationTokenTest extends EntityTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testFail_bulkTokenNotSpecifiedRenewalBehavior() {
|
void testFail_bulkTokenInvalidRenewalBehavior() {
|
||||||
|
assertThat(
|
||||||
|
assertThrows(
|
||||||
|
IllegalArgumentException.class,
|
||||||
|
() ->
|
||||||
|
new AllocationToken.Builder()
|
||||||
|
.setToken("abc123")
|
||||||
|
.setTokenType(TokenType.BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
|
.setRenewalPriceBehavior(RenewalPriceBehavior.DEFAULT)
|
||||||
|
.build()))
|
||||||
|
.hasMessageThat()
|
||||||
|
.isEqualTo("BULK_PRICING tokens must have renewalPriceBehavior set to SPECIFIED");
|
||||||
|
|
||||||
|
assertThat(
|
||||||
|
assertThrows(
|
||||||
|
IllegalArgumentException.class,
|
||||||
|
() ->
|
||||||
|
new AllocationToken.Builder()
|
||||||
|
.setToken("abc123")
|
||||||
|
.setTokenType(TokenType.BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 5))
|
||||||
|
.build()))
|
||||||
|
.hasMessageThat()
|
||||||
|
.isEqualTo("BULK_PRICING tokens must have a renewal price of 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testFailure_bulkTokenDiscountFraction() {
|
||||||
AllocationToken.Builder builder =
|
AllocationToken.Builder builder =
|
||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(TokenType.BULK_PRICING)
|
.setTokenType(TokenType.BULK_PRICING)
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.DEFAULT);
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0));
|
||||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||||
assertThat(thrown)
|
assertThat(thrown)
|
||||||
.hasMessageThat()
|
.hasMessageThat()
|
||||||
.isEqualTo("Bulk tokens must have renewalPriceBehavior set to SPECIFIED");
|
.isEqualTo("BULK_PRICING tokens must have a discountFraction of 1.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -237,12 +277,14 @@ public class AllocationTokenTest extends EntityTestCase {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(TokenType.BULK_PRICING)
|
.setTokenType(TokenType.BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE, CommandName.RESTORE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE, CommandName.RESTORE))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED);
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0));
|
||||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||||
assertThat(thrown)
|
assertThat(thrown)
|
||||||
.hasMessageThat()
|
.hasMessageThat()
|
||||||
.isEqualTo("Bulk tokens may only be valid for CREATE actions");
|
.isEqualTo("BULK_PRICING tokens may only be valid for CREATE actions");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -263,11 +305,13 @@ public class AllocationTokenTest extends EntityTestCase {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(TokenType.BULK_PRICING)
|
.setTokenType(TokenType.BULK_PRICING)
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED);
|
.setDiscountFraction(1.0)
|
||||||
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0));
|
||||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||||
assertThat(thrown)
|
assertThat(thrown)
|
||||||
.hasMessageThat()
|
.hasMessageThat()
|
||||||
.isEqualTo("Bulk tokens may only be valid for CREATE actions");
|
.isEqualTo("BULK_PRICING tokens may only be valid for CREATE actions");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -276,11 +320,15 @@ public class AllocationTokenTest extends EntityTestCase {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("abc123")
|
.setToken("abc123")
|
||||||
.setTokenType(TokenType.BULK_PRICING)
|
.setTokenType(TokenType.BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0))
|
||||||
.setDiscountPremiums(true);
|
.setDiscountPremiums(true);
|
||||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||||
assertThat(thrown).hasMessageThat().isEqualTo("Bulk tokens cannot discount premium names");
|
assertThat(thrown)
|
||||||
|
.hasMessageThat()
|
||||||
|
.isEqualTo("BULK_PRICING tokens cannot discount premium names");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -338,8 +386,10 @@ public class AllocationTokenTest extends EntityTestCase {
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("foobar")
|
.setToken("foobar")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("foo", "bar"));
|
.setAllowedRegistrarIds(ImmutableSet.of("foo", "bar"));
|
||||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||||
assertThat(thrown)
|
assertThat(thrown)
|
||||||
@@ -536,6 +586,32 @@ public class AllocationTokenTest extends EntityTestCase {
|
|||||||
.isEqualTo("Discount years can only be specified along with a discount fraction");
|
.isEqualTo("Discount years can only be specified along with a discount fraction");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testBuild_specifiedTokenInvalidBehavior() {
|
||||||
|
assertThat(
|
||||||
|
assertThrows(
|
||||||
|
IllegalArgumentException.class,
|
||||||
|
() ->
|
||||||
|
new AllocationToken.Builder()
|
||||||
|
.setToken("abc")
|
||||||
|
.setTokenType(SINGLE_USE)
|
||||||
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.build()))
|
||||||
|
.hasMessageThat()
|
||||||
|
.isEqualTo("renewalPrice must be specified iff renewalPriceBehavior is SPECIFIED");
|
||||||
|
assertThat(
|
||||||
|
assertThrows(
|
||||||
|
IllegalArgumentException.class,
|
||||||
|
() ->
|
||||||
|
new AllocationToken.Builder()
|
||||||
|
.setToken("abc")
|
||||||
|
.setTokenType(SINGLE_USE)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 10))
|
||||||
|
.build()))
|
||||||
|
.hasMessageThat()
|
||||||
|
.isEqualTo("renewalPrice must be specified iff renewalPriceBehavior is SPECIFIED");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testBuild_registrationBehaviors() {
|
void testBuild_registrationBehaviors() {
|
||||||
createTld("tld");
|
createTld("tld");
|
||||||
|
|||||||
@@ -55,8 +55,9 @@ public class BulkPricingPackageTest extends EntityTestCase {
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
BulkPricingPackage bulkPricingPackage =
|
BulkPricingPackage bulkPricingPackage =
|
||||||
@@ -84,7 +85,7 @@ public class BulkPricingPackageTest extends EntityTestCase {
|
|||||||
.setCreationTimeForTest(DateTime.parse("2010-11-12T05:00:00Z"))
|
.setCreationTimeForTest(DateTime.parse("2010-11-12T05:00:00Z"))
|
||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
IllegalArgumentException thrown =
|
IllegalArgumentException thrown =
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
|||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||||
|
import static org.joda.money.CurrencyUnit.USD;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
@@ -46,8 +47,9 @@ public class CreateBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--max_domains=100",
|
"--max_domains=100",
|
||||||
@@ -78,7 +80,8 @@ public class CreateBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
.setDiscountFraction(1)
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
IllegalArgumentException thrown =
|
IllegalArgumentException thrown =
|
||||||
assertThrows(
|
assertThrows(
|
||||||
@@ -122,8 +125,9 @@ public class CreateBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
runCommandForced(
|
runCommandForced(
|
||||||
"--max_domains=100",
|
"--max_domains=100",
|
||||||
@@ -158,8 +162,9 @@ public class CreateBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
runCommandForced("--price=USD 1000.00", "--next_billing_date=2012-03-17T00:00:00Z", "abc123");
|
runCommandForced("--price=USD 1000.00", "--next_billing_date=2012-03-17T00:00:00Z", "abc123");
|
||||||
Optional<BulkPricingPackage> bulkPricingPackageOptional =
|
Optional<BulkPricingPackage> bulkPricingPackageOptional =
|
||||||
@@ -184,8 +189,9 @@ public class CreateBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
runCommandForced("--max_domains=100", "--max_creates=500", "--price=USD 1000.00", "abc123");
|
runCommandForced("--max_domains=100", "--max_creates=500", "--price=USD 1000.00", "abc123");
|
||||||
|
|
||||||
@@ -210,8 +216,9 @@ public class CreateBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
IllegalArgumentException thrown =
|
IllegalArgumentException thrown =
|
||||||
assertThrows(
|
assertThrows(
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ import google.registry.util.StringGenerator.Alphabets;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import org.joda.money.CurrencyUnit;
|
||||||
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -194,19 +196,47 @@ class GenerateAllocationTokensCommandTest extends CommandTestCase<GenerateAlloca
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_renewalPriceBehaviorIsSpecified() throws Exception {
|
void testSuccess_renewalPriceBehaviorIsSpecified() throws Exception {
|
||||||
runCommand("--tokens", "foobar,foobaz", "--renewal_price_behavior", "SPECIFIED");
|
runCommand(
|
||||||
|
"--tokens",
|
||||||
|
"foobar,foobaz",
|
||||||
|
"--renewal_price_behavior",
|
||||||
|
"SPECIFIED",
|
||||||
|
"--renewal_price",
|
||||||
|
"USD 10");
|
||||||
assertAllocationTokens(
|
assertAllocationTokens(
|
||||||
createToken("foobar", null, null).asBuilder().setRenewalPriceBehavior(SPECIFIED).build(),
|
createToken("foobar", null, null)
|
||||||
createToken("foobaz", null, null).asBuilder().setRenewalPriceBehavior(SPECIFIED).build());
|
.asBuilder()
|
||||||
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 10))
|
||||||
|
.build(),
|
||||||
|
createToken("foobaz", null, null)
|
||||||
|
.asBuilder()
|
||||||
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 10))
|
||||||
|
.build());
|
||||||
assertInStdout("foobar", "foobaz");
|
assertInStdout("foobar", "foobaz");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_renewalPriceBehaviorIsSpecifiedButMixedCase() throws Exception {
|
void testSuccess_renewalPriceBehaviorIsSpecifiedButMixedCase() throws Exception {
|
||||||
runCommand("--tokens", "foobar,foobaz", "--renewal_price_behavior", "speCIFied");
|
runCommand(
|
||||||
|
"--tokens",
|
||||||
|
"foobar,foobaz",
|
||||||
|
"--renewal_price_behavior",
|
||||||
|
"speCIFied",
|
||||||
|
"--renewal_price",
|
||||||
|
"USD 10");
|
||||||
assertAllocationTokens(
|
assertAllocationTokens(
|
||||||
createToken("foobar", null, null).asBuilder().setRenewalPriceBehavior(SPECIFIED).build(),
|
createToken("foobar", null, null)
|
||||||
createToken("foobaz", null, null).asBuilder().setRenewalPriceBehavior(SPECIFIED).build());
|
.asBuilder()
|
||||||
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 10))
|
||||||
|
.build(),
|
||||||
|
createToken("foobaz", null, null)
|
||||||
|
.asBuilder()
|
||||||
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 10))
|
||||||
|
.build());
|
||||||
assertInStdout("foobar", "foobaz");
|
assertInStdout("foobar", "foobaz");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,6 +266,16 @@ class GenerateAllocationTokensCommandTest extends CommandTestCase<GenerateAlloca
|
|||||||
+ " NONPREMIUM, SPECIFIED]");
|
+ " NONPREMIUM, SPECIFIED]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testFailure_specifiedPrice_withoutPrice() throws Exception {
|
||||||
|
assertThat(
|
||||||
|
assertThrows(
|
||||||
|
IllegalArgumentException.class,
|
||||||
|
() -> runCommand("--tokens", "foobar", "--renewal_price_behavior", "SPECIFIED")))
|
||||||
|
.hasMessageThat()
|
||||||
|
.isEqualTo("renewal_price must be specified iff renewal_price_behavior is SPECIFIED");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_defaultRegistrationBehavior() throws Exception {
|
void testSuccess_defaultRegistrationBehavior() throws Exception {
|
||||||
runCommand("--tokens", "foobar,blah");
|
runCommand("--tokens", "foobar,blah");
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package google.registry.tools;
|
|||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
|
import static org.joda.money.CurrencyUnit.USD;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import com.beust.jcommander.ParameterException;
|
import com.beust.jcommander.ParameterException;
|
||||||
@@ -52,8 +53,9 @@ public class GetBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
BulkPricingPackage bulkPricingPackage =
|
BulkPricingPackage bulkPricingPackage =
|
||||||
new BulkPricingPackage.Builder()
|
new BulkPricingPackage.Builder()
|
||||||
@@ -79,8 +81,9 @@ public class GetBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
tm().transact(
|
tm().transact(
|
||||||
() ->
|
() ->
|
||||||
@@ -102,8 +105,9 @@ public class GetBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
tm().transact(
|
tm().transact(
|
||||||
() ->
|
() ->
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName
|
|||||||
import google.registry.model.domain.token.AllocationToken;
|
import google.registry.model.domain.token.AllocationToken;
|
||||||
import google.registry.model.domain.token.AllocationToken.RegistrationBehavior;
|
import google.registry.model.domain.token.AllocationToken.RegistrationBehavior;
|
||||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||||
|
import org.joda.money.CurrencyUnit;
|
||||||
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@@ -159,16 +161,22 @@ class UpdateAllocationTokensCommandTest extends CommandTestCase<UpdateAllocation
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdateRenewalPriceBehavior_setToSpecified() throws Exception {
|
void testUpdateRenewalPriceBehavior_setToSpecified() throws Exception {
|
||||||
AllocationToken token = persistResource(builderWithPromo().setDiscountFraction(0.5).build());
|
AllocationToken token = persistResource(builderWithPromo().build());
|
||||||
runCommandForced("--prefix", "token", "--renewal_price_behavior", "SPECIFIED");
|
runCommandForced(
|
||||||
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(SPECIFIED);
|
"--prefix", "token", "--renewal_price_behavior", "SPECIFIED", "--renewal_price", "USD 1");
|
||||||
|
token = reloadResource(token);
|
||||||
|
assertThat(token.getRenewalPriceBehavior()).isEqualTo(SPECIFIED);
|
||||||
|
assertThat(token.getRenewalPrice()).hasValue(Money.of(CurrencyUnit.USD, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdateRenewalPriceBehavior_setToDefault() throws Exception {
|
void testUpdateRenewalPriceBehavior_setToDefault() throws Exception {
|
||||||
AllocationToken token =
|
AllocationToken token =
|
||||||
persistResource(
|
persistResource(
|
||||||
builderWithPromo().setRenewalPriceBehavior(SPECIFIED).setDiscountFraction(0.5).build());
|
builderWithPromo()
|
||||||
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 1))
|
||||||
|
.build());
|
||||||
runCommandForced("--prefix", "token", "--renewal_price_behavior", "default");
|
runCommandForced("--prefix", "token", "--renewal_price_behavior", "default");
|
||||||
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(DEFAULT);
|
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(DEFAULT);
|
||||||
}
|
}
|
||||||
@@ -177,7 +185,10 @@ class UpdateAllocationTokensCommandTest extends CommandTestCase<UpdateAllocation
|
|||||||
void testUpdateRenewalPriceBehavior_setToNonPremium() throws Exception {
|
void testUpdateRenewalPriceBehavior_setToNonPremium() throws Exception {
|
||||||
AllocationToken token =
|
AllocationToken token =
|
||||||
persistResource(
|
persistResource(
|
||||||
builderWithPromo().setRenewalPriceBehavior(SPECIFIED).setDiscountFraction(0.5).build());
|
builderWithPromo()
|
||||||
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 1))
|
||||||
|
.build());
|
||||||
runCommandForced("--prefix", "token", "--renewal_price_behavior", "NONpremium");
|
runCommandForced("--prefix", "token", "--renewal_price_behavior", "NONpremium");
|
||||||
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(NONPREMIUM);
|
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(NONPREMIUM);
|
||||||
}
|
}
|
||||||
@@ -193,11 +204,26 @@ class UpdateAllocationTokensCommandTest extends CommandTestCase<UpdateAllocation
|
|||||||
void testUpdateRenewalPriceBehavior_setFromSpecifiedToSpecified() throws Exception {
|
void testUpdateRenewalPriceBehavior_setFromSpecifiedToSpecified() throws Exception {
|
||||||
AllocationToken token =
|
AllocationToken token =
|
||||||
persistResource(
|
persistResource(
|
||||||
builderWithPromo().setRenewalPriceBehavior(SPECIFIED).setDiscountFraction(0.5).build());
|
builderWithPromo()
|
||||||
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 1))
|
||||||
|
.build());
|
||||||
runCommandForced("--prefix", "token", "--renewal_price_behavior", "SPecified");
|
runCommandForced("--prefix", "token", "--renewal_price_behavior", "SPecified");
|
||||||
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(SPECIFIED);
|
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(SPECIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testFailure_nonSpecifiedToSpecified_withoutPrice() throws Exception {
|
||||||
|
persistResource(builderWithPromo().build());
|
||||||
|
assertThat(
|
||||||
|
assertThrows(
|
||||||
|
IllegalArgumentException.class,
|
||||||
|
() ->
|
||||||
|
runCommandForced("--prefix", "token", "--renewal_price_behavior", "SPECIFIED")))
|
||||||
|
.hasMessageThat()
|
||||||
|
.isEqualTo("renewalPrice must be specified iff renewalPriceBehavior is SPECIFIED");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdateRenewalPriceBehavior_setFromNonPremiumToDefault() throws Exception {
|
void testUpdateRenewalPriceBehavior_setFromNonPremiumToDefault() throws Exception {
|
||||||
AllocationToken token =
|
AllocationToken token =
|
||||||
@@ -214,7 +240,10 @@ class UpdateAllocationTokensCommandTest extends CommandTestCase<UpdateAllocation
|
|||||||
void testUpdateRenewalPriceBehavior_setToMixedCaseDefault() throws Exception {
|
void testUpdateRenewalPriceBehavior_setToMixedCaseDefault() throws Exception {
|
||||||
AllocationToken token =
|
AllocationToken token =
|
||||||
persistResource(
|
persistResource(
|
||||||
builderWithPromo().setRenewalPriceBehavior(SPECIFIED).setDiscountFraction(0.5).build());
|
builderWithPromo()
|
||||||
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 1))
|
||||||
|
.build());
|
||||||
runCommandForced("--prefix", "token", "--renewal_price_behavior", "deFauLt");
|
runCommandForced("--prefix", "token", "--renewal_price_behavior", "deFauLt");
|
||||||
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(DEFAULT);
|
assertThat(reloadResource(token).getRenewalPriceBehavior()).isEqualTo(DEFAULT);
|
||||||
}
|
}
|
||||||
@@ -350,7 +379,9 @@ class UpdateAllocationTokensCommandTest extends CommandTestCase<UpdateAllocation
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("token")
|
.setToken("token")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setTokenStatusTransitions(
|
.setTokenStatusTransitions(
|
||||||
@@ -377,7 +408,9 @@ class UpdateAllocationTokensCommandTest extends CommandTestCase<UpdateAllocation
|
|||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("token")
|
.setToken("token")
|
||||||
.setTokenType(BULK_PRICING)
|
.setTokenType(BULK_PRICING)
|
||||||
|
.setDiscountFraction(1.0)
|
||||||
.setRenewalPriceBehavior(SPECIFIED)
|
.setRenewalPriceBehavior(SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(CurrencyUnit.USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setTokenStatusTransitions(
|
.setTokenStatusTransitions(
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package google.registry.tools;
|
|||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
|
import static org.joda.money.CurrencyUnit.USD;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
@@ -47,8 +48,9 @@ public class UpdateBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
BulkPricingPackage bulkPricingPackage =
|
BulkPricingPackage bulkPricingPackage =
|
||||||
new BulkPricingPackage.Builder()
|
new BulkPricingPackage.Builder()
|
||||||
@@ -94,8 +96,9 @@ public class UpdateBulkPricingPackageCommandTest
|
|||||||
.setAllowedTlds(ImmutableSet.of("foo"))
|
.setAllowedTlds(ImmutableSet.of("foo"))
|
||||||
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
.setAllowedRegistrarIds(ImmutableSet.of("TheRegistrar"))
|
||||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||||
|
.setRenewalPrice(Money.of(USD, 0))
|
||||||
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
.setAllowedEppActions(ImmutableSet.of(CommandName.CREATE))
|
||||||
.setDiscountFraction(1)
|
.setDiscountFraction(1.0)
|
||||||
.build());
|
.build());
|
||||||
IllegalArgumentException thrown =
|
IllegalArgumentException thrown =
|
||||||
assertThrows(
|
assertThrows(
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,8 @@
|
|||||||
redemption_domain_repo_id text,
|
redemption_domain_repo_id text,
|
||||||
redemption_domain_history_id int8,
|
redemption_domain_history_id int8,
|
||||||
registration_behavior text not null,
|
registration_behavior text not null,
|
||||||
|
renewal_price_amount numeric(19, 2),
|
||||||
|
renewal_price_currency text,
|
||||||
renewal_price_behavior text not null,
|
renewal_price_behavior text not null,
|
||||||
token_status_transitions hstore,
|
token_status_transitions hstore,
|
||||||
token_type text,
|
token_type text,
|
||||||
|
|||||||
Reference in New Issue
Block a user