mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 08:57:12 +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 google.registry.util.ResourceUtils.readResourceUtf8;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
|
@ -50,17 +51,17 @@ public abstract class CreateOrUpdateReservedListCommandTestCase
|
|||
|
||||
@Test
|
||||
public void testFailure_fileDoesntExist() throws Exception {
|
||||
thrown.expect(ParameterException.class);
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c-blah",
|
||||
"--input=" + reservedTermsPath + "-nonexistent");
|
||||
assertThrows(
|
||||
ParameterException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c-blah", "--input=" + reservedTermsPath + "-nonexistent"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_fileDoesntParse() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
runCommandForced(
|
||||
"--name=xn--q9jyb4c-blork",
|
||||
"--input=" + invalidReservedTermsPath);
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> runCommandForced("--name=xn--q9jyb4c-blork", "--input=" + invalidReservedTermsPath));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue