MessageLoggingToggle implements ApplicationListener<ContextRefreshedEvent> { public void switchOnMessageLogging() { requestProcessor.enableProcessor(jmsRequestLoggerProcessor); responseProcessor.enableProcessor(jmsResponseProcessor); }  @Override void onApplicationEvent(final ContextRefreshedEvent event); void switchOffMessageLogging(); void switchOnMessageLogging(); boolean isRequestLoggingOn(); boolean isResponseLoggingOn();  }
@Test public final void testSwitchOnMessageLoggingAddsBothProcessors() { underTest.switchOnMessageLogging(); verify(requestHandler).enableProcessor(jmsRequestLogger); verify(responseHandler).enableProcessor(jmsResponseProcessor); }