RequestRecord { public String addContextTag(String key, String tag) { if (key == null || tag == null) { return null; } else { ctxFields.add(key); return LogContext.add(key, tag); } } RequestRecord(String layerKey);  RequestRecord(String layerKey, Direction direction); Value addValue(String key, Value value); String addTag(String key, String tag); String addContextTag(String key, String tag); void resetContext(); long start(); long stop(); @Override String toString();  }
@Test public void testContext() throws JSONObjectException, IOException { MDC.clear(); String layer = "testContext"; String reqId = "1-2-3-4"; rrec = new RequestRecord(layer); rrec.addContextTag(Fields.REQUEST_ID, reqId); assertThat(getField(Fields.REQUEST_ID), is(nullValue())); assertThat(MDC.getCopyOfContextMap().get(Fields.REQUEST_ID), is(reqId)); }