diff --git a/java/google/registry/tools/CheckDomainCommand.java b/java/google/registry/tools/CheckDomainCommand.java index 9f5baf02f..d8377698f 100644 --- a/java/google/registry/tools/CheckDomainCommand.java +++ b/java/google/registry/tools/CheckDomainCommand.java @@ -22,7 +22,7 @@ import google.registry.tools.soy.DomainCheckSoyInfo; import java.util.Collection; import java.util.List; -/** A command to execute a domain check epp command. */ +/** A command to execute a domain check EPP command (including cost of a 1 year create). */ @Parameters(separators = " =", commandDescription = "Check domain availability") final class CheckDomainCommand extends NonMutatingEppToolCommand { diff --git a/java/google/registry/tools/CheckDomainFeeCommand.java b/java/google/registry/tools/CheckDomainFeeCommand.java deleted file mode 100644 index 743122732..000000000 --- a/java/google/registry/tools/CheckDomainFeeCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2018 The Nomulus 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.tools; - -import com.beust.jcommander.Parameter; -import com.beust.jcommander.Parameters; -import com.google.common.collect.Multimap; -import com.google.template.soy.data.SoyMapData; -import google.registry.tools.soy.DomainCheckFeeSoyInfo; -import java.util.Collection; -import java.util.List; - -/** A command to execute a domain check fees epp command. */ -@Parameters(separators = " =", commandDescription = "Check domain fees (for a 1-year create)") -final class CheckDomainFeeCommand extends NonMutatingEppToolCommand { - - @Parameter( - names = {"-c", "--client"}, - description = "Client identifier of the registrar to execute the command as", - required = true) - String clientId; - - @Parameter( - description = "Domain(s) to check.", - required = true) - List mainParameters; - - @Override - void initEppToolCommand() { - Multimap domainNameMap = validateAndGroupDomainNamesByTld(mainParameters); - for (Collection values : domainNameMap.asMap().values()) { - setSoyTemplate(DomainCheckFeeSoyInfo.getInstance(), DomainCheckFeeSoyInfo.DOMAINCHECKFEE); - addSoyRecord(clientId, new SoyMapData("domainNames", values)); - } - } -} diff --git a/java/google/registry/tools/RegistryTool.java b/java/google/registry/tools/RegistryTool.java index 5f9c24cae..eee918d55 100644 --- a/java/google/registry/tools/RegistryTool.java +++ b/java/google/registry/tools/RegistryTool.java @@ -33,7 +33,6 @@ public final class RegistryTool { .put("canonicalize_labels", CanonicalizeLabelsCommand.class) .put("check_domain", CheckDomainCommand.class) .put("check_domain_claims", CheckDomainClaimsCommand.class) - .put("check_domain_fee", CheckDomainFeeCommand.class) .put("check_snapshot", CheckSnapshotCommand.class) .put("convert_idn", ConvertIdnCommand.class) .put("count_domains", CountDomainsCommand.class) diff --git a/java/google/registry/tools/soy/DomainCheck.soy b/java/google/registry/tools/soy/DomainCheck.soy index 3520cf549..35dfa8c36 100644 --- a/java/google/registry/tools/soy/DomainCheck.soy +++ b/java/google/registry/tools/soy/DomainCheck.soy @@ -29,6 +29,17 @@ {/for} + + + {for $d in $domainNames} + + {$d} + create + 1 + + {/for} + + RegistryTool diff --git a/java/google/registry/tools/soy/DomainCheckFee.soy b/java/google/registry/tools/soy/DomainCheckFee.soy deleted file mode 100644 index 06e0eb636..000000000 --- a/java/google/registry/tools/soy/DomainCheckFee.soy +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 The Nomulus 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. - -{namespace domain.registry.tools} - -/** - * Domain check fee request - */ -{template .domaincheckfee stricthtml="false"} -{@param domainNames: list} - - - - - - {for $d in $domainNames} - {$d} - {/for} - - - - - {for $d in $domainNames} - - {$d} - create - 1 - - {/for} - - - RegistryTool - - -{/template} diff --git a/javatests/google/registry/tools/CheckDomainCommandTest.java b/javatests/google/registry/tools/CheckDomainCommandTest.java index f0095edb7..a10d09de4 100644 --- a/javatests/google/registry/tools/CheckDomainCommandTest.java +++ b/javatests/google/registry/tools/CheckDomainCommandTest.java @@ -25,7 +25,7 @@ public class CheckDomainCommandTest extends EppToolCommandTestCase { - - @Test - public void testSuccess() throws Exception { - runCommand("--client=NewRegistrar", "example.tld"); - eppVerifier.expectDryRun().verifySent("domain_check_fee.xml"); - } - - @Test - public void testSuccess_multipleTlds() throws Exception { - runCommand("--client=NewRegistrar", "example.tld", "example.tld2"); - eppVerifier - .expectDryRun() - .verifySent("domain_check_fee.xml") - .verifySent("domain_check_fee_second_tld.xml"); - } - - @Test - public void testSuccess_multipleDomains() throws Exception { - runCommand( - "--client=NewRegistrar", - "example.tld", - "example2.tld", - "example3.tld"); - eppVerifier.expectDryRun().verifySent("domain_check_fee_multiple.xml"); - } - - @Test - public void testSuccess_multipleDomainsAndTlds() throws Exception { - runCommand( - "--client=NewRegistrar", - "example.tld", - "example2.tld", - "example3.tld", - "example.tld2"); - eppVerifier - .expectDryRun() - .verifySent("domain_check_fee_multiple.xml") - .verifySent("domain_check_fee_second_tld.xml"); - } - - @Test - public void testFailure_missingClientId() throws Exception { - assertThrows(ParameterException.class, () -> runCommand("example.tld")); - } - - @Test - public void testFailure_NoMainParameter() throws Exception { - assertThrows(ParameterException.class, () -> runCommand("--client=NewRegistrar")); - } - - @Test - public void testFailure_unknownFlag() throws Exception { - assertThrows( - ParameterException.class, - () -> runCommand("--client=NewRegistrar", "--unrecognized=foo", "example.tld")); - } -} diff --git a/javatests/google/registry/tools/server/testdata/domain_check_multiple.xml b/javatests/google/registry/tools/server/testdata/domain_check_multiple.xml deleted file mode 100644 index 667e2de8d..000000000 --- a/javatests/google/registry/tools/server/testdata/domain_check_multiple.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - example.tld - example2.tld - example3.tld - - - RegistryTool - - diff --git a/javatests/google/registry/tools/server/testdata/domain_check_second_tld.xml b/javatests/google/registry/tools/server/testdata/domain_check_second_tld.xml deleted file mode 100644 index 974b4d261..000000000 --- a/javatests/google/registry/tools/server/testdata/domain_check_second_tld.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - example.tld2 - - - RegistryTool - -