mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02: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:
parent
68a26f5b6e
commit
b825a2b5a8
144 changed files with 1176 additions and 894 deletions
|
@ -93,7 +93,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_nonexistentParentRegistrar() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "Registrar FakeRegistrar not found");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Registrar FakeRegistrar not found");
|
||||
runCommandForced(
|
||||
"--registrar=FakeRegistrar",
|
||||
"--type=PROMOTION",
|
||||
|
@ -104,7 +105,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_nonexistentTld() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "faketld");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("faketld");
|
||||
runCommandForced(
|
||||
"--registrar=TheRegistrar",
|
||||
"--type=PROMOTION",
|
||||
|
@ -115,7 +117,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_nonexistentType() throws Exception {
|
||||
thrown.expect(ParameterException.class, "Invalid value for --type");
|
||||
thrown.expect(ParameterException.class);
|
||||
thrown.expectMessage("Invalid value for --type");
|
||||
runCommandForced(
|
||||
"--registrar=TheRegistrar",
|
||||
"--type=BADTYPE",
|
||||
|
@ -126,7 +129,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_negativeBalance() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "negative");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("negative");
|
||||
runCommandForced(
|
||||
"--registrar=TheRegistrar",
|
||||
"--type=PROMOTION",
|
||||
|
@ -137,7 +141,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_noRegistrar() throws Exception {
|
||||
thrown.expect(ParameterException.class, "--registrar");
|
||||
thrown.expect(ParameterException.class);
|
||||
thrown.expectMessage("--registrar");
|
||||
runCommandForced(
|
||||
"--type=PROMOTION",
|
||||
"--tld=tld",
|
||||
|
@ -147,7 +152,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_noType() throws Exception {
|
||||
thrown.expect(ParameterException.class, "--type");
|
||||
thrown.expect(ParameterException.class);
|
||||
thrown.expectMessage("--type");
|
||||
runCommandForced(
|
||||
"--registrar=TheRegistrar",
|
||||
"--tld=tld",
|
||||
|
@ -157,7 +163,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_noTld() throws Exception {
|
||||
thrown.expect(ParameterException.class, "--tld");
|
||||
thrown.expect(ParameterException.class);
|
||||
thrown.expectMessage("--tld");
|
||||
runCommandForced(
|
||||
"--registrar=TheRegistrar",
|
||||
"--type=PROMOTION",
|
||||
|
@ -167,7 +174,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_noBalance() throws Exception {
|
||||
thrown.expect(ParameterException.class, "--balance");
|
||||
thrown.expect(ParameterException.class);
|
||||
thrown.expectMessage("--balance");
|
||||
runCommandForced(
|
||||
"--registrar=TheRegistrar",
|
||||
"--type=PROMOTION",
|
||||
|
@ -177,7 +185,8 @@ public class CreateCreditCommandTest extends CommandTestCase<CreateCreditCommand
|
|||
|
||||
@Test
|
||||
public void testFailure_noEffectiveTime() throws Exception {
|
||||
thrown.expect(ParameterException.class, "--effective_time");
|
||||
thrown.expect(ParameterException.class);
|
||||
thrown.expectMessage("--effective_time");
|
||||
runCommandForced(
|
||||
"--registrar=TheRegistrar",
|
||||
"--type=PROMOTION",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue