Let's say I have something like this in my production code:
var username = "fred";
MDC.put("user", username);
logger.warn("The user " + username + " has requested xyz");
I would like to be able to check that the message contains a string that matches a certain MDC key:
logCaptureListener.logged(aLog().withMdc("user", ???).withMessage(Mathers.containsString(<whatever was in Mdc>));
Perhaps this feature can be delivered in a similar way to Mockito's or Mockk's "capture" facitilities.
Let's say I have something like this in my production code:
I would like to be able to check that the message contains a string that matches a certain MDC key:
Perhaps this feature can be delivered in a similar way to Mockito's or Mockk's "capture" facitilities.