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