mirror of
https://github.com/google/nomulus
synced 2026-09-12 11:06:29 +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:
@@ -166,8 +166,8 @@ public class LordnTaskTest {
|
||||
.setRepoId("9000-EXAMPLE")
|
||||
.setCreationClientId("nonexistentRegistrar")
|
||||
.build();
|
||||
thrown.expect(
|
||||
IllegalStateException.class, "No registrar found for client id: nonexistentRegistrar");
|
||||
thrown.expect(IllegalStateException.class);
|
||||
thrown.expectMessage("No registrar found for client id: nonexistentRegistrar");
|
||||
persistDomainAndEnqueueLordn(domain);
|
||||
}
|
||||
|
||||
@@ -198,7 +198,8 @@ public class LordnTaskTest {
|
||||
public void test_loadAllTasks_retryLogic_allFailures() throws Exception {
|
||||
Queue queue = mock(Queue.class);
|
||||
when(queue.leaseTasks(any(LeaseOptions.class))).thenThrow(TransientFailureException.class);
|
||||
thrown.expect(RuntimeException.class, "Error leasing tasks");
|
||||
thrown.expect(RuntimeException.class);
|
||||
thrown.expectMessage("Error leasing tasks");
|
||||
LordnTask.loadAllTasks(queue, "tld");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user