mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +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
|
@ -70,7 +70,8 @@ public class RdeRevisionTest {
|
|||
|
||||
@Test
|
||||
public void testSaveRevision_objectDoesntExist_newRevisionIsOne_throwsVe() throws Exception {
|
||||
thrown.expect(VerifyException.class, "object missing");
|
||||
thrown.expect(VerifyException.class);
|
||||
thrown.expectMessage("object missing");
|
||||
ofy().transact(new VoidWork() {
|
||||
@Override
|
||||
public void vrun() {
|
||||
|
@ -81,7 +82,8 @@ public class RdeRevisionTest {
|
|||
@Test
|
||||
public void testSaveRevision_objectExistsAtZero_newRevisionIsZero_throwsVe() throws Exception {
|
||||
save("melancholy", DateTime.parse("1984-12-18TZ"), FULL, 0);
|
||||
thrown.expect(VerifyException.class, "object already created");
|
||||
thrown.expect(VerifyException.class);
|
||||
thrown.expectMessage("object already created");
|
||||
ofy().transact(new VoidWork() {
|
||||
@Override
|
||||
public void vrun() {
|
||||
|
@ -108,7 +110,8 @@ public class RdeRevisionTest {
|
|||
@Test
|
||||
public void testSaveRevision_objectExistsAtZero_newRevisionIsTwo_throwsVe() throws Exception {
|
||||
save("melancholy", DateTime.parse("1984-12-18TZ"), FULL, 0);
|
||||
thrown.expect(VerifyException.class, "should be at 1 ");
|
||||
thrown.expect(VerifyException.class);
|
||||
thrown.expectMessage("should be at 1 ");
|
||||
ofy().transact(new VoidWork() {
|
||||
@Override
|
||||
public void vrun() {
|
||||
|
@ -118,7 +121,8 @@ public class RdeRevisionTest {
|
|||
|
||||
@Test
|
||||
public void testSaveRevision_negativeRevision_throwsIae() throws Exception {
|
||||
thrown.expect(IllegalArgumentException.class, "Negative revision");
|
||||
thrown.expect(IllegalArgumentException.class);
|
||||
thrown.expectMessage("Negative revision");
|
||||
ofy().transact(new VoidWork() {
|
||||
@Override
|
||||
public void vrun() {
|
||||
|
@ -128,7 +132,8 @@ public class RdeRevisionTest {
|
|||
|
||||
@Test
|
||||
public void testSaveRevision_callerNotInTransaction_throwsIse() throws Exception {
|
||||
thrown.expect(IllegalStateException.class, "transaction");
|
||||
thrown.expect(IllegalStateException.class);
|
||||
thrown.expectMessage("transaction");
|
||||
saveRevision("frenzy", DateTime.parse("1984-12-18TZ"), FULL, 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue