Follow

TIL: Wanna test logging output in with logback and JUnit?

Just create a ListAppender and add it to the logger using logger.addAppender(myListAppender) in the unit test.

In the end you can go through the messages in the list appender and check your assertions. :)

Sign in to participate in the conversation
Meinungsschublade

Gemütliche Mastodon-Instanz über Dies und Das :)