mirror of
https://github.com/google/nomulus
synced 2026-09-29 03:05:42 +00:00
Get rid of custom ExceptionRule methods
The only remaining methods on ExceptionRule after this are methods that also exist on ExpectedException, which will allow us to, in the next CL, swap out the one for the other and then run the automated refactoring to turn it all into assertThrows/expectThrows. Note that there were some assertions about root causes that couldn't easily be turned into ExpectedException invocations, so I simply converted them directly to usages of assertThrows/expectThrows. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=178623431
This commit is contained in:
@@ -150,21 +150,24 @@ public class UniformRapidSuspensionCommandTest
|
||||
@Test
|
||||
public void testFailure_locksToPreserveWithoutUndo() throws Exception {
|
||||
persistActiveDomain("evil.tld");
|
||||
thrown.expect(IllegalArgumentException.class, "--undo");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("--undo");
|
||||
runCommandForced("--domain_name=evil.tld", "--locks_to_preserve=serverDeleteProhibited");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameRequired() throws Exception {
|
||||
persistActiveDomain("evil.tld");
|
||||
thrown.expect(ParameterException.class, "--domain_name");
|
||||
thrown.expect(ParameterException.class);
|
||||
thrown.expectMessage("--domain_name");
|
||||
runCommandForced("--hosts=urs1.example.com,urs2.example.com");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_extraFieldInDsData() throws Exception {
|
||||
persistActiveDomain("evil.tld");
|
||||
thrown.expect(IllegalArgumentException.class, "Incorrect fields on --dsdata JSON");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Incorrect fields on --dsdata JSON");
|
||||
runCommandForced(
|
||||
"--domain_name=evil.tld",
|
||||
"--dsdata={\"keyTag\":1,\"alg\":1,\"digestType\":1,\"digest\":\"abc\",\"foo\":1}");
|
||||
@@ -173,7 +176,8 @@ public class UniformRapidSuspensionCommandTest
|
||||
@Test
|
||||
public void testFailure_missingFieldInDsData() throws Exception {
|
||||
persistActiveDomain("evil.tld");
|
||||
thrown.expect(IllegalArgumentException.class, "Incorrect fields on --dsdata JSON");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Incorrect fields on --dsdata JSON");
|
||||
runCommandForced(
|
||||
"--domain_name=evil.tld",
|
||||
"--dsdata={\"keyTag\":1,\"alg\":1,\"digestType\":1}");
|
||||
@@ -182,7 +186,8 @@ public class UniformRapidSuspensionCommandTest
|
||||
@Test
|
||||
public void testFailure_malformedDsData() throws Exception {
|
||||
persistActiveDomain("evil.tld");
|
||||
thrown.expect(IllegalArgumentException.class, "Invalid --dsdata JSON");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Invalid --dsdata JSON");
|
||||
runCommandForced(
|
||||
"--domain_name=evil.tld",
|
||||
"--dsdata=[1,2,3]");
|
||||
|
||||
Reference in New Issue
Block a user