mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 16:37:13 +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
|
@ -20,6 +20,7 @@ import static google.registry.testing.DatastoreHelper.newContactResourceWithRoid
|
|||
import static google.registry.testing.DatastoreHelper.newDomainApplication;
|
||||
import static google.registry.testing.DatastoreHelper.newSunriseApplication;
|
||||
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;
|
||||
|
||||
|
@ -320,19 +321,16 @@ public class GenerateAuctionDataCommandTest extends CommandTestCase<GenerateAuct
|
|||
|
||||
@Test
|
||||
public void testFailure_missingTldName() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommand();
|
||||
assertThrows(ParameterException.class, () -> runCommand());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_tooManyParameters() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
runCommand("xn--q9jyb4c", "foobar");
|
||||
assertThrows(IllegalArgumentException.class, () -> runCommand("xn--q9jyb4c", "foobar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_nonexistentTld() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
runCommand("foobarbaz");
|
||||
assertThrows(IllegalArgumentException.class, () -> runCommand("foobarbaz"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue