MessageLoggingToggle implements ApplicationListener<ContextRefreshedEvent> { public boolean isResponseLoggingOn() { return responseProcessor.isProcessorEnabled(jmsResponseProcessor); }  @Override void onApplicationEvent(final ContextRefreshedEvent event); void switchOffMessageLogging(); void switchOnMessageLogging(); boolean isRequestLoggingOn(); boolean isResponseLoggingOn();  }
@Test public final void testIsResponseLoggingOnReturnsTrueIfHandlerContainsProcessor() { given(responseHandler.containsProcessor(jmsResponseProcessor)).willReturn(true); given(responseHandler.isProcessorEnabled(jmsResponseProcessor)).willReturn(true); boolean actual = underTest.isResponseLoggingOn(); verify(responseHandler).isProcessorEnabled(jmsResponseProcessor); assertTrue(actual); }
@Test public final void testIsResponseLoggingOnReturnsFalseIfHandlerDoesntContainProcessor() { given(responseHandler.containsProcessor(jmsResponseProcessor)).willReturn(false); boolean actual = underTest.isResponseLoggingOn(); verify(responseHandler).isProcessorEnabled(jmsResponseProcessor); assertFalse(actual); }