Skip to content

Commit

Permalink
fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
cleaning-agent committed Nov 24, 2023
1 parent 6a10ef5 commit 4be02c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</developers>

<properties>
<project.version>3.5.0-SNAPSHOT</project.version>
<project.version>3.5.1-SNAPSHOT</project.version>

<java.version>1.8</java.version>
<lombok.version>1.18.22</lombok.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static String loggedExceptionToString(Optional<LoggedEvent.LoggedExcepti

LoggedEvent.LoggedException loggedException = optionalException.get();

return format("message: \"%s\", message: %s%s",
return format("message: \"%s\", type: %s%s",
loggedException.getMessage(),
loggedException.getType(),
loggedException.getCause().isPresent() ? format(", cause: (%s)", loggedExceptionToString(loggedException.getCause())) : ""
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/example/app/ReadableApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void expectedExceptionFails() {

assertThat(assertionError).hasMessage("Expected log message has occurred, but never with the expected Exception: Level: WARN, Regex: \"oh no!\"" +
lineSeparator() + " expected exception: message (regex): \"a message never used\" type: java.lang.RuntimeException" +
lineSeparator() + " actual exception: message: \"this is illegal\", message: java.lang.IllegalArgumentException, cause: (message: \"never be null!\", message: java.lang.NullPointerException)" +
lineSeparator() + " actual exception: message: \"this is illegal\", type: java.lang.IllegalArgumentException, cause: (message: \"never be null!\", type: java.lang.NullPointerException)" +
lineSeparator());

AssertionError withoutExceptionAssertionError = assertThrows(AssertionError.class,
Expand Down Expand Up @@ -695,7 +695,7 @@ void combinedLogExpectationsOnlyOutputMismatch() {

assertThat(assertionError).hasMessage("Expected log message has occurred, but never with the expected Exception: Level: ERROR, Regex: \"some error\"" +
lineSeparator() + " expected exception: message (regex): \"an exception that was not logged\"" +
lineSeparator() + " actual exception: message: \"an exception that was logged\", message: java.lang.RuntimeException" +
lineSeparator() + " actual exception: message: \"an exception that was logged\", type: java.lang.RuntimeException" +
lineSeparator());
}
}

0 comments on commit 4be02c4

Please sign in to comment.