Don't prompt to confirm non-mutating nomulus EPP tool commands

This is accomplished by making all non-mutating commands function with dry run set
to true, which also has the pleasurable side effect of not prompting for dry-run
mutating commands either, which also do nothing different/special on the second
run.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192149150
This commit is contained in:
mcilwain 2018-04-09 10:40:20 -07:00 committed by Ben McIlwain
parent 013558c814
commit 3bbaf585e5
15 changed files with 248 additions and 48 deletions

View file

@ -24,55 +24,57 @@ public class DomainCheckFeeCommandTest extends EppToolCommandTestCase<DomainChec
@Test
public void testSuccess() throws Exception {
runCommandForced("--client=NewRegistrar", "example.tld");
eppVerifier.verifySent("domain_check_fee.xml");
runCommand("--client=NewRegistrar", "example.tld");
eppVerifier.expectDryRun().verifySent("domain_check_fee.xml");
}
@Test
public void testSuccess_multipleTlds() throws Exception {
runCommandForced("--client=NewRegistrar", "example.tld", "example.tld2");
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 {
runCommandForced(
runCommand(
"--client=NewRegistrar",
"example.tld",
"example2.tld",
"example3.tld");
eppVerifier.verifySent("domain_check_fee_multiple.xml");
eppVerifier.expectDryRun().verifySent("domain_check_fee_multiple.xml");
}
@Test
public void testSuccess_multipleDomainsAndTlds() throws Exception {
runCommandForced(
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, () -> runCommandForced("example.tld"));
assertThrows(ParameterException.class, () -> runCommand("example.tld"));
}
@Test
public void testFailure_NoMainParameter() throws Exception {
assertThrows(ParameterException.class, () -> runCommandForced("--client=NewRegistrar"));
assertThrows(ParameterException.class, () -> runCommand("--client=NewRegistrar"));
}
@Test
public void testFailure_unknownFlag() throws Exception {
assertThrows(
ParameterException.class,
() -> runCommandForced("--client=NewRegistrar", "--unrecognized=foo", "example.tld"));
() -> runCommand("--client=NewRegistrar", "--unrecognized=foo", "example.tld"));
}
}