I encountered a tricky problem today, I was writing a test for which the assertion was onto some function called or not. I couldn’t mock that function as it was part of an external API for which I couldn’t change the real Object to a mocked Object. There was a solution, checking that this function was logging a particular event or not. So in order to assert that this specific line was logged or no
![Unit testing : Asserting that a line was logged by Logback - DZone](https://cdn-ak-scissors.b.st-hatena.com/image/square/3da4ee72886726d450c0bf633da8f691e3085c3b/height=288;version=1;width=512/https%3A%2F%2Fdz2cdn2.dzone.com%2Fstorage%2Farticle-thumb%2F227437-thumb.jpg)