SuspendablesRunner { public List<SuspensionResult> findAndRunSuspendables(final UUID commandId, final SuspensionCommand suspensionCommand) { if (suspensionCommand.isSuspendCommand()) { return suspensionRunner.runSuspension(commandId, suspensionCommand); } return unsuspensionRunner.runUsuspension(commandId, suspensionCommand); }  List<SuspensionResult> findAndRunSuspendables(final UUID commandId, final SuspensionCommand suspensionCommand);  }
@Test public void shouldRunSuspensionIfCommandIsSuspendCommand() throws Exception { final UUID commandId = randomUUID(); final SuspendCommand suspendCommand = new SuspendCommand(); suspendablesRunner.findAndRunSuspendables(commandId, suspendCommand); verify(suspensionRunner).runSuspension(commandId, suspendCommand); }
@Test public void shouldRunUnsuspensionIfCommandIsUnsuspendCommand() throws Exception { final UUID commandId = randomUUID(); final UnsuspendCommand unsuspendCommand = new UnsuspendCommand(); suspendablesRunner.findAndRunSuspendables(commandId, unsuspendCommand); verify(unsuspensionRunner).runUsuspension(commandId, unsuspendCommand); }