mirror of
https://github.com/google/nomulus.git
synced 2025-08-12 12:39:39 +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
|
@ -16,6 +16,7 @@ package google.registry.tools;
|
|||
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import org.junit.Test;
|
||||
|
@ -38,20 +39,17 @@ public class GetTldCommandTest extends CommandTestCase<GetTldCommand> {
|
|||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
runCommand("xn--q9jyb4c");
|
||||
assertThrows(IllegalArgumentException.class, () -> runCommand("xn--q9jyb4c"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_noTldName() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommand();
|
||||
assertThrows(ParameterException.class, () -> runCommand());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_oneTldDoesNotExist() throws Exception {
|
||||
createTld("xn--q9jyb4c");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
runCommand("xn--q9jyb4c", "example");
|
||||
assertThrows(IllegalArgumentException.class, () -> runCommand("xn--q9jyb4c", "example"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue