SequenceHandlingToggle implements ApplicationListener<ContextRefreshedEvent> { public void switchOff() { sequenceManager.dropAllSequences(); sequenceRequestHandlingProcessor.setEnabled(false); }  void switchOn(); void switchOff(); boolean isOn(); @Override void onApplicationEvent(final ContextRefreshedEvent event);  }
@Test public void testSwitchOffShouldDisableSequenceHandling() { underTest.switchOff(); verify(sequenceRequestHandlingProcessor).setEnabled(false); }
@Test public void testSwitchOffShouldDropTheSequences() { underTest.switchOff(); verify(sequenceManager).dropAllSequences(); }