mirror of
https://github.com/google/nomulus
synced 2026-09-04 23:27:11 +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:
@@ -55,13 +55,15 @@ public class SerializeUtilsTest {
|
||||
|
||||
@Test
|
||||
public void testSerialize_objectDoesntImplementSerialize_hasInformativeError() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "Unable to serialize: LOL_VALUE");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Unable to serialize: LOL_VALUE");
|
||||
serialize(new Lol());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeserialize_badValue_hasInformativeError() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "Unable to deserialize: objectBytes=FF");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Unable to deserialize: objectBytes=FF");
|
||||
deserialize(String.class, new byte[] { (byte) 0xff });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user