google-nomulus/javatests/google/registry/flows/host
cgoldfeder f3a0b78145 Move thrown.expect() right before the throwing statement
aka regexing for fun and profit.

This also makes sure that there are no statements after the
throwing statement, since these would be dead code. There
were a surprising number of places with assertions after
the throw, and none of these are actually triggered in tests
ever. When I found these, I replaced them with try/catch/rethrow
which makes the assertions actually happen:

before:

// This is the ExceptionRule that checks EppException marshaling
thrown.expect(FooException.class);
doThrowingThing();
assertSomething();  // Dead code!

after:

try {
  doThrowingThing();
  assertWithMessage("...").fail();
} catch (FooException e) {
  assertSomething();
  // For EppExceptions:
  assertAboutEppExceptins().that(e).marshalsToXml();
}

To make this work, I added EppExceptionSubject.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135793407
2016-10-11 11:27:54 -04:00
..
testdata Let all mutating flows accept metadata extension 2016-05-27 12:48:06 -04:00
HostCheckFlowTest.java Fix confusing "now" parameters on persist deleted helper methods 2016-10-03 16:20:03 -04:00
HostCreateFlowTest.java Fix confusing "now" parameters on persist deleted helper methods 2016-10-03 16:20:03 -04:00
HostDeleteFlowTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
HostInfoFlowTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
HostUpdateFlowTest.java Cut over to batched DNS refreshing on host renames 2016-10-03 16:42:24 -04:00