LocalhostRequestProcessorToggle implements ApplicationListener<ContextRefreshedEvent> { public boolean isOn() { return localhostRequestProcessor.isEnabled(); }  void switchOff(); void switchOn(); boolean isOn(); @Override void onApplicationEvent(final ContextRefreshedEvent event);  }
@Test public void testIsOnShouldReturnTrueIfLocalhostRequestProcessorIsEnabled() { given(localhostRequestProcessor.isEnabled()).willReturn(true); boolean result = underTest.isOn(); assertTrue(result); }
@Test public void testIsOnShouldReturnFalseIfLocalhostRequestProcessorIsDisabled() { given(localhostRequestProcessor.isEnabled()).willReturn(false); boolean result = underTest.isOn(); assertFalse(result); }