Skip to content

Commit

Permalink
Polish contribution
Browse files Browse the repository at this point in the history
Issue: #1703
  • Loading branch information
sbrannen committed Dec 18, 2018
1 parent bdbea61 commit b8dc032
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ private static <T> T assertDoesNotThrow(ThrowingSupplier<T> supplier, Object mes

private static AssertionFailedError createAssertionFailedError(Object messageOrSupplier, Throwable t) {
String message = buildPrefix(nullSafeGet(messageOrSupplier)) + "Unexpected exception thrown: "
+ t.getClass().getName() + addThrowableMessage(t);
+ t.getClass().getName() + buildSuffix(t.getLocalizedMessage());
return new AssertionFailedError(message, t);
}

private static String addThrowableMessage(Throwable t) {
return StringUtils.isBlank(t.getMessage()) ? "" : ": " + t.getMessage();
private static String buildSuffix(String message) {
return StringUtils.isNotBlank(message) ? ": " + message : "";
}

}

0 comments on commit b8dc032

Please sign in to comment.