mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Automatically refactor more exception testing to use new JUnit rules
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=179072309
This commit is contained in:
parent
d5d29959b4
commit
9157930983
100 changed files with 3900 additions and 3192 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
|
@ -77,19 +78,20 @@ public class ExecuteEppCommandTest extends EppToolCommandTestCase<ExecuteEppComm
|
|||
|
||||
@Test
|
||||
public void testFailure_missingClientId() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommand("--force", "foo.xml");
|
||||
assertThrows(ParameterException.class, () -> runCommand("--force", "foo.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_forceAndDryRunIncompatible() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
runCommand("--client=NewRegistrar", "--force", "--dry_run", eppFile);
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> runCommand("--client=NewRegistrar", "--force", "--dry_run", eppFile));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unknownFlag() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommand("--client=NewRegistrar", "--unrecognized=foo", "--force", "foo.xml");
|
||||
assertThrows(
|
||||
ParameterException.class,
|
||||
() -> runCommand("--client=NewRegistrar", "--unrecognized=foo", "--force", "foo.xml"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue