mirror of
https://github.com/google/nomulus
synced 2026-09-06 08:07:03 +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:
@@ -83,13 +83,15 @@ public class EppResourceInputsTest {
|
||||
|
||||
@Test
|
||||
public void testFailure_keyInputType_polymorphicSubclass() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "non-polymorphic");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("non-polymorphic");
|
||||
createKeyInput(DomainResource.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_keyInputType_noInheritanceBetweenTypes_eppResource() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "inheritance");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("inheritance");
|
||||
createKeyInput(EppResource.class, DomainBase.class);
|
||||
}
|
||||
|
||||
@@ -102,13 +104,15 @@ public class EppResourceInputsTest {
|
||||
|
||||
@Test
|
||||
public void testFailure_entityInputType_noInheritanceBetweenTypes_eppResource() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "inheritance");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("inheritance");
|
||||
createEntityInput(EppResource.class, DomainResource.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_entityInputType_noInheritanceBetweenTypes_subclasses() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "inheritance");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("inheritance");
|
||||
createEntityInput(DomainBase.class, DomainResource.class);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user