AbstractSubmit: Remove redundant assertion about null IOException

The call to assertThat(e).isNull() causes ErrorProne to raise a
warning that there is a missing call to fail(), because it thinks
that the exception is expected.

Instead of asserting on the IOException, rethrow it as the cause
of a new ValidationException.

Change-Id: I7dd681196f8d63eb6f2a0063b55aa94d0ec1d71f
This commit is contained in:
David Pursehouse
2018-09-06 17:49:16 +09:00
parent 429687d2ad
commit 818264876a

View File

@@ -760,7 +760,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest {
try (RevWalk rw = args.newRevWalk()) {
rw.parseBody(rw.parseCommit(args.getCommands().get("refs/heads/master").getNewId()));
} catch (IOException e) {
assertThat(e).isNull();
throw new ValidationException("Unexpected exception", e);
}
projectsCalled.add(args.getProject().get());
if (projectsCalled.size() == 2) {