mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +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,8 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -59,19 +61,18 @@ public class DomainCheckCommandTest extends EppToolCommandTestCase<DomainCheckCo
|
|||
|
||||
@Test
|
||||
public void testFailure_missingClientId() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommandForced("example.tld");
|
||||
assertThrows(ParameterException.class, () -> runCommandForced("example.tld"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_NoMainParameter() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommandForced("--client=NewRegistrar");
|
||||
assertThrows(ParameterException.class, () -> runCommandForced("--client=NewRegistrar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_unknownFlag() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommandForced("--client=NewRegistrar", "--unrecognized=foo", "example.tld");
|
||||
assertThrows(
|
||||
ParameterException.class,
|
||||
() -> runCommandForced("--client=NewRegistrar", "--unrecognized=foo", "example.tld"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue