Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 4.0.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cleaning-agent committed Nov 24, 2023
2 parents b6712ac + 17724cd commit fd62f68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ logCapture.assertLoggedInOrder(
* [Cucumber feature file](#cucumber-feature-file)
* [Changes](#changes)
* [4.0.0](#400)
* [3.6.2](#362)
* [3.6.1](#361)
* [3.6.0](#360)
* [3.5.0](#350)
Expand Down Expand Up @@ -330,6 +331,10 @@ And with MDC logging context
* added a new log event matcher [for key-value content](#key-value)
* lots of dependency updates

### 3.6.2

* Fixed an assertion message concerning captured Exceptions.

### 3.6.1

* Fixed a misleading and wrong assertion message. The assertion itself was correct, but the message always said all matchers did not match when only a subset did not match.
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 @@ -160,7 +160,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 @@ -720,7 +720,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());
}

Expand Down

0 comments on commit fd62f68

Please sign in to comment.