mirror of
https://github.com/google/nomulus
synced 2026-09-19 14:34:18 +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:
@@ -186,18 +186,16 @@ public class LoadSnapshotActionTest {
|
||||
@Test
|
||||
public void testFailure_doPost_badGcsFilename() throws Exception {
|
||||
action.snapshotFile = "gs://bucket/snapshot";
|
||||
thrown.expect(
|
||||
BadRequestException.class,
|
||||
"Error calling load snapshot: backup info file extension missing");
|
||||
thrown.expect(BadRequestException.class);
|
||||
thrown.expectMessage("Error calling load snapshot: backup info file extension missing");
|
||||
action.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_doPost_bigqueryThrowsException() throws Exception {
|
||||
when(bigqueryJobsInsert.execute()).thenThrow(new IOException("The Internet has gone missing"));
|
||||
thrown.expect(
|
||||
InternalServerErrorException.class,
|
||||
"Error loading snapshot: The Internet has gone missing");
|
||||
thrown.expect(InternalServerErrorException.class);
|
||||
thrown.expectMessage("Error loading snapshot: The Internet has gone missing");
|
||||
action.run();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user