mirror of
https://github.com/google/nomulus.git
synced 2025-05-19 02:39:34 +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
|
@ -97,7 +97,8 @@ public final class DnsInjectionTest {
|
|||
public void testRefreshDns_missingDomain_throwsNotFound() throws Exception {
|
||||
when(req.getParameter("type")).thenReturn("domain");
|
||||
when(req.getParameter("name")).thenReturn("example.lol");
|
||||
thrown.expect(NotFoundException.class, "domain example.lol not found");
|
||||
thrown.expect(NotFoundException.class);
|
||||
thrown.expectMessage("domain example.lol not found");
|
||||
component.refreshDns().run();
|
||||
}
|
||||
|
||||
|
@ -114,7 +115,8 @@ public final class DnsInjectionTest {
|
|||
public void testRefreshDns_missingHost_throwsNotFound() throws Exception {
|
||||
when(req.getParameter("type")).thenReturn("host");
|
||||
when(req.getParameter("name")).thenReturn("ns1.example.lol");
|
||||
thrown.expect(NotFoundException.class, "host ns1.example.lol not found");
|
||||
thrown.expect(NotFoundException.class);
|
||||
thrown.expectMessage("host ns1.example.lol not found");
|
||||
component.refreshDns().run();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue