Unit Testing Log4j2 in Kotlin
When unit testing a class, we would usually mock or stub any dependencies required. The conventional approach to unit testing if we logged a message would be to create a mock implementation of the logger class. We then verify that the mock logger invoked the logging method. For Log4j2, we can use a simpler approach of injecting a custom Appender…