TinylogLoggerProvider implements LoggerProvider { @Override public Object getMdc(final String key) { return ThreadContext.get(key); } TinylogLoggerProvider(); @Override Logger getLogger(final String name); @Override void clearMdc(); @Override Object putMdc(final String key, final Object value); @Override Object getMdc(final String key); @Override void removeMdc(final String key); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override Map<String, Object> getMdcMap(); @Override void clearNdc(); @Override String getNdc(); @Override int getNdcDepth(); @Override String popNdc(); @Override String peekNdc(); @Override void pushNdc(final String message); @Override void setNdcMaxDepth(final int maxDepth);  }
@Test public void getMdc() { when(logging.getMdc("test")).thenReturn("42"); assertThat(context.get("test")).isEqualTo("42"); }