ObjectUtilsTest#testIdentityToStringAppendable: fail test if IOException is thrown

This commit is contained in:
pascalschumacher 2017-02-14 22:59:12 +01:00
parent aaeb4c621a
commit 5bdf0a938a
1 changed files with 6 additions and 2 deletions

View File

@ -257,13 +257,17 @@ public void testIdentityToStringAppendable() {
try { try {
ObjectUtils.identityToString((Appendable)null, "tmp"); ObjectUtils.identityToString((Appendable)null, "tmp");
fail("NullPointerException expected"); fail("NullPointerException expected");
} catch(final NullPointerException | IOException npe) { } catch(final NullPointerException expectedException) {
} catch(final IOException ex) {
fail("IOException unexpected");
} }
try { try {
ObjectUtils.identityToString((Appendable)(new StringBuilder()), null); ObjectUtils.identityToString((Appendable)(new StringBuilder()), null);
fail("NullPointerException expected"); fail("NullPointerException expected");
} catch(final NullPointerException | IOException npe) { } catch(final NullPointerException expectedException) {
} catch(final IOException ex) {
fail("IOException unexpected");
} }
} }