mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 15:11:26 +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
|
@ -124,7 +124,8 @@ public class CheckSnapshotActionTest {
|
|||
public void testPost_forPendingBackup_returnsNotModified() throws Exception {
|
||||
setPendingBackup();
|
||||
|
||||
thrown.expect(NotModifiedException.class, "Datastore backup some_backup still pending");
|
||||
thrown.expect(NotModifiedException.class);
|
||||
thrown.expectMessage("Datastore backup some_backup still pending");
|
||||
action.run();
|
||||
}
|
||||
|
||||
|
@ -140,9 +141,8 @@ public class CheckSnapshotActionTest {
|
|||
.plus(Duration.standardMinutes(3))
|
||||
.plus(Duration.millis(1234)));
|
||||
|
||||
thrown.expect(
|
||||
NoContentException.class,
|
||||
"Datastore backup some_backup abandoned - "
|
||||
thrown.expect(NoContentException.class);
|
||||
thrown.expectMessage("Datastore backup some_backup abandoned - "
|
||||
+ "not complete after 20 hours, 3 minutes and 1 second");
|
||||
|
||||
action.run();
|
||||
|
@ -188,7 +188,8 @@ public class CheckSnapshotActionTest {
|
|||
when(backupService.findByName("some_backup"))
|
||||
.thenThrow(new IllegalArgumentException("No backup found"));
|
||||
|
||||
thrown.expect(BadRequestException.class, "Bad backup name some_backup: No backup found");
|
||||
thrown.expect(BadRequestException.class);
|
||||
thrown.expectMessage("Bad backup name some_backup: No backup found");
|
||||
|
||||
action.run();
|
||||
}
|
||||
|
@ -219,7 +220,8 @@ public class CheckSnapshotActionTest {
|
|||
when(backupService.findByName("some_backup"))
|
||||
.thenThrow(new IllegalArgumentException("No backup found"));
|
||||
|
||||
thrown.expect(BadRequestException.class, "Bad backup name some_backup: No backup found");
|
||||
thrown.expect(BadRequestException.class);
|
||||
thrown.expectMessage("Bad backup name some_backup: No backup found");
|
||||
|
||||
action.run();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue