mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Refactor Fee class to support EAP fee
Currently EapFee is a separate class that has no inheritance from either BaseFee and Fee. With this CL its functionality is merged into the Fee class and the type of the fee can be identified by the FeeType enum in the Fee class. Future custom fees can follow the same pattern. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133627570
This commit is contained in:
parent
0518f63aad
commit
77571e2063
9 changed files with 121 additions and 131 deletions
|
@ -15,7 +15,6 @@
|
|||
package google.registry.flows.domain;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static google.registry.model.EppResourceUtils.loadByUniqueId;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.pricing.PricingEngineProxy.getPricesForDomainName;
|
||||
|
@ -34,7 +33,6 @@ import google.registry.model.domain.LrpToken;
|
|||
import google.registry.model.domain.fee.BaseFee;
|
||||
import google.registry.model.domain.fee.BaseFee.FeeType;
|
||||
import google.registry.model.domain.fee.Credit;
|
||||
import google.registry.model.domain.fee.EapFee;
|
||||
import google.registry.model.domain.fee.Fee;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.pricing.PremiumPricingEngine.DomainPrices;
|
||||
|
@ -160,14 +158,9 @@ public final class TldSpecificLogicProxy {
|
|||
}
|
||||
|
||||
// Create fees for the cost and the EAP fee, if any.
|
||||
EapFee eapFee = registry.getEapFeeFor(date);
|
||||
Money eapFeeCost = eapFee.getCost();
|
||||
checkState(eapFeeCost.getCurrencyUnit().equals(currency));
|
||||
if (!eapFeeCost.getAmount().equals(Money.zero(currency).getAmount())) {
|
||||
return new EppCommandOperations(
|
||||
currency,
|
||||
createFeeOrCredit,
|
||||
Fee.create(eapFeeCost.getAmount(), FeeType.EAP, eapFee.getPeriod().upperEndpoint()));
|
||||
Fee eapFee = registry.getEapFeeFor(date);
|
||||
if (!eapFee.hasZeroCost()) {
|
||||
return new EppCommandOperations(currency, createFeeOrCredit, eapFee);
|
||||
} else {
|
||||
return new EppCommandOperations(currency, createFeeOrCredit);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ package google.registry.model.domain.fee;
|
|||
import static com.google.common.base.MoreObjects.firstNonNull;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
import com.google.common.collect.Range;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.xml.PeriodAdapter;
|
||||
import java.math.BigDecimal;
|
||||
|
@ -25,6 +26,7 @@ import javax.xml.bind.annotation.XmlEnumValue;
|
|||
import javax.xml.bind.annotation.XmlTransient;
|
||||
import javax.xml.bind.annotation.XmlValue;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.Period;
|
||||
|
||||
/** Base class for the fee and credit types. */
|
||||
|
@ -79,6 +81,9 @@ public abstract class BaseFee extends ImmutableObject {
|
|||
@XmlTransient
|
||||
FeeType type;
|
||||
|
||||
@XmlTransient
|
||||
Range<DateTime> validDateRange;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
@ -110,11 +115,19 @@ public abstract class BaseFee extends ImmutableObject {
|
|||
return type;
|
||||
}
|
||||
|
||||
public boolean hasValidDateRange() {
|
||||
return validDateRange != null;
|
||||
}
|
||||
|
||||
protected void generateDescription(Object... args) {
|
||||
checkState(type != null);
|
||||
description = type.renderDescription(args);
|
||||
}
|
||||
|
||||
public boolean hasZeroCost() {
|
||||
return cost.signum() == 0;
|
||||
}
|
||||
|
||||
public boolean hasDefaultAttributes() {
|
||||
return getGracePeriod().equals(Period.ZERO)
|
||||
&& getApplied().equals(AppliedType.IMMEDIATE)
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.model.domain.fee;
|
||||
|
||||
import static google.registry.util.PreconditionsUtils.checkArgumentNotNull;
|
||||
|
||||
import com.google.common.collect.Range;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
* An object representing an EAP fee (as a {@link Money}) along with the interval for which the
|
||||
* fee applies.
|
||||
*/
|
||||
public class EapFee {
|
||||
|
||||
/** The EAP fee (as applied on top of the domain registration cost). */
|
||||
Money cost;
|
||||
|
||||
/** The time period for which the fee applies. */
|
||||
Range<DateTime> period;
|
||||
|
||||
public Money getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public Range<DateTime> getPeriod() {
|
||||
return period;
|
||||
}
|
||||
|
||||
public static EapFee create(Money cost, Range<DateTime> period) {
|
||||
EapFee instance = new EapFee();
|
||||
instance.cost = checkArgumentNotNull(cost, "EAP fee cost cannot be null.");
|
||||
instance.period = checkArgumentNotNull(period, "EAP fee period cannot be null.");
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Range;
|
||||
import google.registry.model.domain.fee06.FeeCheckCommandExtensionV06;
|
||||
import google.registry.model.domain.fee06.FeeCreateCommandExtensionV06;
|
||||
import google.registry.model.domain.fee06.FeeRenewCommandExtensionV06;
|
||||
|
@ -36,6 +37,7 @@ import google.registry.model.domain.fee12.FeeTransferCommandExtensionV12;
|
|||
import google.registry.model.domain.fee12.FeeUpdateCommandExtensionV12;
|
||||
import google.registry.model.eppcommon.ProtocolDefinition.ServiceExtension;
|
||||
import java.math.BigDecimal;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
* A fee, in currency units specified elsewhere in the xml, with type of the fee an optional fee
|
||||
|
@ -51,6 +53,13 @@ public class Fee extends BaseFee {
|
|||
return instance;
|
||||
}
|
||||
|
||||
public static Fee create(
|
||||
BigDecimal cost, FeeType type, Range<DateTime> validDateRange, Object... descriptionArgs) {
|
||||
Fee instance = create(cost, type, descriptionArgs);
|
||||
instance.validDateRange = validDateRange;
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static final ImmutableList<
|
||||
Class<? extends FeeCheckCommandExtension<
|
||||
? extends FeeCheckCommandExtensionItem, ? extends FeeCheckResponseExtension<?>>>>
|
||||
|
@ -91,8 +100,7 @@ public class Fee extends BaseFee {
|
|||
FeeUpdateCommandExtensionV11.class,
|
||||
FeeUpdateCommandExtensionV06.class);
|
||||
|
||||
public static final ImmutableSet<String>
|
||||
FEE_EXTENSION_URIS =
|
||||
public static final ImmutableSet<String> FEE_EXTENSION_URIS =
|
||||
ImmutableSet.<String>of(
|
||||
ServiceExtension.FEE_0_12.getUri(),
|
||||
ServiceExtension.FEE_0_11.getUri(),
|
||||
|
|
|
@ -56,7 +56,8 @@ import google.registry.model.ImmutableObject;
|
|||
import google.registry.model.common.EntityGroupRoot;
|
||||
import google.registry.model.common.TimedTransitionProperty;
|
||||
import google.registry.model.common.TimedTransitionProperty.TimedTransition;
|
||||
import google.registry.model.domain.fee.EapFee;
|
||||
import google.registry.model.domain.fee.BaseFee.FeeType;
|
||||
import google.registry.model.domain.fee.Fee;
|
||||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.model.registry.label.ReservedList;
|
||||
import google.registry.util.Idn;
|
||||
|
@ -518,15 +519,19 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
/**
|
||||
* Returns the EAP fee for the registry at the given time.
|
||||
*/
|
||||
public EapFee getEapFeeFor(DateTime now) {
|
||||
public Fee getEapFeeFor(DateTime now) {
|
||||
ImmutableSortedMap<DateTime, Money> valueMap = eapFeeSchedule.toValueMap();
|
||||
DateTime periodStart = valueMap.floorKey(now);
|
||||
DateTime periodEnd = valueMap.ceilingKey(now);
|
||||
return EapFee.create(
|
||||
eapFeeSchedule.getValueAtTime(now),
|
||||
Range.closedOpen(
|
||||
// NOTE: assuming END_OF_TIME would never be reached...
|
||||
Range<DateTime> validPeriod = Range.closedOpen(
|
||||
periodStart != null ? periodStart : START_OF_TIME,
|
||||
periodEnd != null ? periodEnd : END_OF_TIME));
|
||||
periodEnd != null ? periodEnd : END_OF_TIME);
|
||||
return Fee.create(
|
||||
eapFeeSchedule.getValueAtTime(now).getAmount(),
|
||||
FeeType.EAP,
|
||||
validPeriod,
|
||||
validPeriod.upperEndpoint());
|
||||
}
|
||||
|
||||
public String getLordnUsername() {
|
||||
|
|
|
@ -171,7 +171,8 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
Money cost = getPricesForDomainName(getUniqueIdFromCommand(), clock.nowUtc()).isPremium()
|
||||
? Money.of(USD, 200)
|
||||
: Money.of(USD, 26);
|
||||
Money eapFee = Registry.get(domainTld).getEapFeeFor(clock.nowUtc()).getCost();
|
||||
Money eapFee = Money.of(Registry.get(domainTld).getCurrency(),
|
||||
Registry.get(domainTld).getEapFeeFor(clock.nowUtc()).getCost());
|
||||
|
||||
DateTime billingTime = isAnchorTenant
|
||||
? clock.nowUtc().plus(Registry.get(domainTld).getAnchorTenantAddGracePeriodLength())
|
||||
|
|
|
@ -24,6 +24,7 @@ import static org.joda.money.CurrencyUnit.USD;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Range;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.ResourceMutateFlow.ResourceToMutateDoesNotExistException;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
|
@ -56,14 +57,11 @@ import org.junit.runners.JUnit4;
|
|||
@RunWith(JUnit4.class)
|
||||
public class TldSpecificLogicProxyTest extends ShardableTestCase {
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
@Rule public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
@Rule public final ExceptionRule thrown = new ExceptionRule();
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
||||
final FakeClock clock = new FakeClock(DateTime.parse("2010-01-01T10:00:00Z"));
|
||||
|
||||
|
@ -103,17 +101,27 @@ public class TldSpecificLogicProxyTest extends ShardableTestCase {
|
|||
TldSpecificLogicProxy.EppCommandOperations createPrice =
|
||||
TldSpecificLogicProxy.getCreatePrice(
|
||||
Registry.get("eap"), "example.eap", "clientIdentifier", clock.nowUtc(), 1, null);
|
||||
Range<DateTime> eapValidPeriod =
|
||||
Range.closedOpen(clock.nowUtc().minusDays(1), clock.nowUtc().plusDays(1));
|
||||
assertThat(createPrice.getTotalCost()).isEqualTo(basicCreateCost.plus(Money.of(USD, 100)));
|
||||
assertThat(createPrice.getCurrency()).isEqualTo(USD);
|
||||
assertThat(createPrice.getFees().get(0))
|
||||
.isEqualTo(Fee.create(basicCreateCost.getAmount(), FeeType.CREATE));
|
||||
assertThat(createPrice.getFees().get(1))
|
||||
.isEqualTo(
|
||||
Fee.create(Money.of(USD, 100).getAmount(), FeeType.EAP, clock.nowUtc().plusDays(1)));
|
||||
Fee.create(
|
||||
new BigDecimal("100.00"),
|
||||
FeeType.EAP,
|
||||
eapValidPeriod,
|
||||
clock.nowUtc().plusDays(1)));
|
||||
assertThat(createPrice.getFees())
|
||||
.containsExactly(
|
||||
Fee.create(basicCreateCost.getAmount(), FeeType.CREATE),
|
||||
Fee.create(Money.of(USD, 100).getAmount(), FeeType.EAP, clock.nowUtc().plusDays(1)))
|
||||
Fee.create(
|
||||
new BigDecimal("100.00"),
|
||||
FeeType.EAP,
|
||||
eapValidPeriod,
|
||||
clock.nowUtc().plusDays(1)))
|
||||
.inOrder();
|
||||
}
|
||||
|
||||
|
@ -151,18 +159,24 @@ public class TldSpecificLogicProxyTest extends ShardableTestCase {
|
|||
|
||||
void persistPendingDeleteDomain(String domainName, DateTime now) throws Exception {
|
||||
DomainResource domain = newDomainResource(domainName);
|
||||
HistoryEntry historyEntry = persistResource(
|
||||
HistoryEntry historyEntry =
|
||||
persistResource(
|
||||
new HistoryEntry.Builder()
|
||||
.setType(HistoryEntry.Type.DOMAIN_DELETE)
|
||||
.setParent(domain)
|
||||
.build());
|
||||
domain = persistResource(domain.asBuilder()
|
||||
domain =
|
||||
persistResource(
|
||||
domain
|
||||
.asBuilder()
|
||||
.setRegistrationExpirationTime(now.plusYears(5).plusDays(45))
|
||||
.setDeletionTime(now.plusDays(35))
|
||||
.addGracePeriod(GracePeriod.create(
|
||||
GracePeriodStatus.REDEMPTION, now.plusDays(1), "foo", null))
|
||||
.addGracePeriod(
|
||||
GracePeriod.create(GracePeriodStatus.REDEMPTION, now.plusDays(1), "foo", null))
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE))
|
||||
.setDeletePollMessage(Key.create(persistResource(
|
||||
.setDeletePollMessage(
|
||||
Key.create(
|
||||
persistResource(
|
||||
new PollMessage.OneTime.Builder()
|
||||
.setClientId("TheRegistrar")
|
||||
.setEventTime(now.plusDays(5))
|
||||
|
|
|
@ -38,6 +38,7 @@ import google.registry.model.registry.Registry.TldState;
|
|||
import google.registry.model.registry.label.PremiumList;
|
||||
import google.registry.model.registry.label.ReservedList;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import java.math.BigDecimal;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
|
@ -414,7 +415,7 @@ public class RegistryTest extends EntityTestCase {
|
|||
@Test
|
||||
public void testEapFee_undefined() {
|
||||
assertThat(Registry.get("tld").getEapFeeFor(clock.nowUtc()).getCost())
|
||||
.isEqualTo(Money.of(USD, 0));
|
||||
.isEqualTo(BigDecimal.ZERO.setScale(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -428,11 +429,12 @@ public class RegistryTest extends EntityTestCase {
|
|||
a, Money.of(USD, 100),
|
||||
b, Money.of(USD, 50))).build();
|
||||
|
||||
assertThat(registry.getEapFeeFor(clock.nowUtc()).getCost()).isEqualTo(Money.of(USD, 100));
|
||||
assertThat(registry.getEapFeeFor(clock.nowUtc()).getCost())
|
||||
.isEqualTo(new BigDecimal("100.00"));
|
||||
assertThat(registry.getEapFeeFor(clock.nowUtc().minusDays(2)).getCost())
|
||||
.isEqualTo(Money.of(USD, 0));
|
||||
.isEqualTo(BigDecimal.ZERO.setScale(2));
|
||||
assertThat(registry.getEapFeeFor(clock.nowUtc().plusDays(2)).getCost())
|
||||
.isEqualTo(Money.of(USD, 50));
|
||||
.isEqualTo(new BigDecimal("50.00"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -32,6 +32,7 @@ import google.registry.model.registry.Registry;
|
|||
import google.registry.model.registry.Registry.TldState;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.PrintStream;
|
||||
import java.math.BigDecimal;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.Before;
|
||||
|
@ -103,10 +104,12 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
"xn--q9jyb4c");
|
||||
|
||||
Registry registry = Registry.get("xn--q9jyb4c");
|
||||
assertThat(registry.getEapFeeFor(now.minusHours(1)).getCost()).isEqualTo(Money.zero(USD));
|
||||
assertThat(registry.getEapFeeFor(now.plusHours(1)).getCost()).isEqualTo(Money.of(USD, 50));
|
||||
assertThat(registry.getEapFeeFor(now.minusHours(1)).getCost())
|
||||
.isEqualTo(BigDecimal.ZERO.setScale(2));
|
||||
assertThat(registry.getEapFeeFor(now.plusHours(1)).getCost())
|
||||
.isEqualTo(new BigDecimal("50.00"));
|
||||
assertThat(registry.getEapFeeFor(now.plusDays(1).plusHours(1)).getCost())
|
||||
.isEqualTo(Money.of(USD, 10));
|
||||
.isEqualTo(new BigDecimal("10.00"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -155,8 +158,7 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
|
||||
@Test
|
||||
public void testSuccess_createBillingCostFlag() throws Exception {
|
||||
runCommandForced(
|
||||
"--create_billing_cost=\"USD 42.42\"", "--roid_suffix=Q9JYB4C", "xn--q9jyb4c");
|
||||
runCommandForced("--create_billing_cost=\"USD 42.42\"", "--roid_suffix=Q9JYB4C", "xn--q9jyb4c");
|
||||
assertThat(Registry.get("xn--q9jyb4c").getStandardCreateCost()).isEqualTo(Money.of(USD, 42.42));
|
||||
}
|
||||
|
||||
|
@ -218,8 +220,7 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
"--initial_tld_state=SUNRISE",
|
||||
"--roid_suffix=Q9JYB4C",
|
||||
"xn--q9jyb4c");
|
||||
assertThat(Registry.get("xn--q9jyb4c").getLrpTldStates())
|
||||
.containsExactly(TldState.SUNRISE);
|
||||
assertThat(Registry.get("xn--q9jyb4c").getLrpTldStates()).containsExactly(TldState.SUNRISE);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -286,8 +287,7 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
thrown.expect(IllegalArgumentException.class);
|
||||
runCommandForced(
|
||||
String.format(
|
||||
"--eap_fee_schedule=\"%s=JPY 123456\"",
|
||||
START_OF_TIME.toString(DATETIME_FORMAT)),
|
||||
"--eap_fee_schedule=\"%s=JPY 123456\"", START_OF_TIME.toString(DATETIME_FORMAT)),
|
||||
"--roid_suffix=Q9JYB4C",
|
||||
"xn--q9jyb4c");
|
||||
}
|
||||
|
@ -351,7 +351,8 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
|
||||
@Test
|
||||
public void testFailure_setReservedListFromOtherTld() throws Exception {
|
||||
runFailureReservedListsTest("tld_banned",
|
||||
runFailureReservedListsTest(
|
||||
"tld_banned",
|
||||
IllegalArgumentException.class,
|
||||
"The reserved list(s) tld_banned cannot be applied to the tld xn--q9jyb4c");
|
||||
}
|
||||
|
@ -363,7 +364,8 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
|
||||
@Test
|
||||
public void testFailure_setCommonAndReservedListFromOtherTld() throws Exception {
|
||||
runFailureReservedListsTest("common_abuse,tld_banned",
|
||||
runFailureReservedListsTest(
|
||||
"common_abuse,tld_banned",
|
||||
IllegalArgumentException.class,
|
||||
"The reserved list(s) tld_banned cannot be applied to the tld xn--q9jyb4c");
|
||||
}
|
||||
|
@ -381,7 +383,8 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
|
||||
@Test
|
||||
public void testFailure_setMultipleReservedListsFromOtherTld() throws Exception {
|
||||
runFailureReservedListsTest("tld_banned,soy_expurgated",
|
||||
runFailureReservedListsTest(
|
||||
"tld_banned,soy_expurgated",
|
||||
IllegalArgumentException.class,
|
||||
"The reserved list(s) tld_banned, soy_expurgated cannot be applied to the tld xn--q9jyb4c");
|
||||
}
|
||||
|
@ -393,7 +396,8 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
|
||||
@Test
|
||||
public void testFailure_setNonExistentReservedLists() throws Exception {
|
||||
runFailureReservedListsTest("xn--q9jyb4c_asdf,common_asdsdgh",
|
||||
runFailureReservedListsTest(
|
||||
"xn--q9jyb4c_asdf,common_asdsdgh",
|
||||
IllegalStateException.class,
|
||||
"Could not find reserved list xn--q9jyb4c_asdf to add to the tld");
|
||||
}
|
||||
|
@ -458,7 +462,8 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
}
|
||||
|
||||
private void runReservedListsTestOverride(String reservedLists) throws Exception {
|
||||
runCommandForced("--override_reserved_list_rules",
|
||||
runCommandForced(
|
||||
"--override_reserved_list_rules",
|
||||
"--reserved_lists",
|
||||
reservedLists,
|
||||
"--roid_suffix=Q9JYB4C",
|
||||
|
@ -466,9 +471,8 @@ public class CreateTldCommandTest extends CommandTestCase<CreateTldCommand> {
|
|||
}
|
||||
|
||||
private void runFailureReservedListsTest(
|
||||
String reservedLists,
|
||||
Class<? extends Exception> errorClass,
|
||||
String errorMsg) throws Exception {
|
||||
String reservedLists, Class<? extends Exception> errorClass, String errorMsg)
|
||||
throws Exception {
|
||||
thrown.expect(errorClass, errorMsg);
|
||||
runCommandForced("--reserved_lists", reservedLists, "--roid_suffix=Q9JYB4C", "xn--q9jyb4c");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue