mirror of
https://github.com/google/nomulus
synced 2026-09-06 08:07:03 +00: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:
@@ -22,6 +22,7 @@ import static google.registry.testing.DatastoreHelper.newHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.JUnitBackports.assertThrows;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
|
||||
@@ -203,13 +204,11 @@ public class GenerateDnsReportCommandTest extends CommandTestCase<GenerateDnsRep
|
||||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
runCommand("--tld=foobar");
|
||||
assertThrows(IllegalArgumentException.class, () -> runCommand("--tld=foobar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_missingTldParameter() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommand("");
|
||||
assertThrows(ParameterException.class, () -> runCommand(""));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user