logger.info("Info Message {}");
verify("List", "o.a.l.l.j.LoggerTest Info Message {} MDC{}" + Constants.LINE_SEP);
}
private void verify(final String name, final String expected) {
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Map<String, Appender<?>> list = ctx.getConfiguration().getAppenders();
final Appender<?> listApp = list.get(name);
assertNotNull("Missing Appender", listApp);
assertTrue("Not a ListAppender", listApp instanceof ListAppender);
final List<String> events = ((ListAppender) listApp).getMessages();
assertTrue("Incorrect number of messages. Expected 1 Actual " + events.size(), events.size()== 1);