TinylogMdcAdapter implements MDCAdapter { @Override public void setContextMap(final Map<String, String> contextMap) { ThreadContext.clear(); for (Entry<String, String> entry : contextMap.entrySet()) { ThreadContext.put(entry.getKey(), entry.getValue()); } } TinylogMdcAdapter(); @Override void put(final String key, final String value); @Override String get(final String key); @Override void remove(final String key); @Override void clear(); @Override Map<String, String> getCopyOfContextMap(); @Override void setContextMap(final Map<String, String> contextMap);  }
@Test public void setContextMap() { new TinylogMdcAdapter().setContextMap(Collections.singletonMap("test", "42")); verify(provider).clear(); verify(provider).put("test", "42"); }