/org.thilo20.logtesting

compare solutions for unit-testing log output

Primary LanguageJava

LogTesting

Small project for exploring how to unit-test log messages.

tldr: Use class ListAppender provided by Logback. See FooTest.java

my requirements / expectations

  • no modifications to production code
  • no extra libs or additional test/mock frameworks
  • no config via file (logback-test.xml)
  • limited modifications to main/test scope in maven/pom.xml
  • test code simple and readable

websites considered / recommend reads

how to use this project

  • clone / import into your favorite IDE
  • inspect / compare the 2 approaches in modules "logback" and "slf4jtest"

optional notes