Skip to content

Commit

Permalink
Better terst assertion messages
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Nov 8, 2023
1 parent 0358d5f commit cf367d8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected void assertDeltaMillis(final String message, final long expectedMillis
// getLastModTimeAccuracy() is not accurate
final long actualDelta = Math.abs(expectedMillis - actualMillis);
if (actualDelta > Math.max(deltaMillis, 1000)) {
Assertions.fail(String.format("%s expected=%,d (%s), actual=%,d (%s), expected delta=%,d, actual delta=%,d millis", message,
Assertions.fail(String.format("%s expected=%,d (%s), actual=%,d (%s), expected delta=%,d millis, actual delta=%,d millis", message,
Long.valueOf(expectedMillis), new Date(expectedMillis).toString(), Long.valueOf(actualMillis), new Date(actualMillis).toString(),
Long.valueOf(deltaMillis), Long.valueOf(actualDelta)));
}
Expand Down

0 comments on commit cf367d8

Please sign in to comment.