I would like to know suggestions for best practices for unit-testing that
logging is correctly performed in the code.

I use Mockito, and have tried a few aproaches which I'm not pleased with.
1. I have tried static mock with Powermockito, but PowerMockito have
several bad effects and screws up code coverage report
2. I have tried configure logging to console and capture System.out, but
that also is clumsy and have several bad effects, and is fragile if someone
changes log4j-test.xml for any reason.

Is it possible to programatic setup so logger created in code is backed by
a Mockito Mock or Capture?

Best Regards
Atle

Reply via email to