WorkflowLogContextListener implements WorkflowExecutorListener { @Override public void afterProcessing(ListenerContext listenerContext) { MDC.remove(logContext); } WorkflowLogContextListener(String logContext); @Override void beforeProcessing(ListenerContext listenerContext); @Override void afterProcessing(ListenerContext listenerContext); @Override void afterFailure(ListenerContext listenerContext, Throwable throwable);  }
@Test void afterProcessingClearsContext() { MDC.put(LOG_CONTEXT, "foo"); listener.afterProcessing(mock(ListenerContext.class)); assertThat(MDC.get(LOG_CONTEXT), is(nullValue())); }