On Unit Testing Logging Messages

from blog Just Some Code, | ↗ original
This post is part of my Advent of Code 2022. These days I had to review some code that expected a controller to log the exceptions thrown in a service. This is how that controller looked and what I learned about testing logging messages. When writing unit tests for logging, assert that actual log messages contain keywords like identifiers or...