LocalhostRequestProcessorToggle implements ApplicationListener<ContextRefreshedEvent> { public void switchOff() { localhostRequestProcessor.setEnabled(false); }  void switchOff(); void switchOn(); boolean isOn(); @Override void onApplicationEvent(final ContextRefreshedEvent event);  }
@Test public void testSwitchOffShouldDisableLocalhostRequestPreprocessor() { underTest.switchOff(); verify(localhostRequestProcessor).setEnabled(false); }