mirror of
https://github.com/google/nomulus
synced 2026-09-19 22:44:26 +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:
@@ -86,13 +86,15 @@ public class RetrierTest {
|
||||
|
||||
@Test
|
||||
public void testRetryableException() throws Exception {
|
||||
thrown.expect(CountingException.class, "3");
|
||||
thrown.expect(CountingException.class);
|
||||
thrown.expectMessage("3");
|
||||
retrier.callWithRetry(new CountingThrower(3), CountingException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnretryableException() throws Exception {
|
||||
thrown.expect(CountingException.class, "1");
|
||||
thrown.expect(CountingException.class);
|
||||
thrown.expectMessage("1");
|
||||
retrier.callWithRetry(new CountingThrower(5), IllegalArgumentException.class);
|
||||
}
|
||||
|
||||
@@ -104,7 +106,8 @@ public class RetrierTest {
|
||||
|
||||
@Test
|
||||
public void testRetryFailed_withReporter() throws Exception {
|
||||
thrown.expect(CountingException.class, "3");
|
||||
thrown.expect(CountingException.class);
|
||||
thrown.expectMessage("3");
|
||||
TestReporter reporter = new TestReporter();
|
||||
try {
|
||||
retrier.callWithRetry(new CountingThrower(3), reporter, CountingException.class);
|
||||
|
||||
Reference in New Issue
Block a user