TriggerInstanceProcessor { public void processSucceed(final TriggerInstance triggerInst) { this.executorService.submit(() -> executeFlowAndUpdateExecID(triggerInst)); } @Inject  TriggerInstanceProcessor(final ExecutorManagerAdapter executorManager,
      final FlowTriggerInstanceLoader flowTriggerInstanceLoader,
      final Emailer emailer); void processSucceed(final TriggerInstance triggerInst); void processTermination(final TriggerInstance triggerInst); void processNewInstance(final TriggerInstance triggerInst); void shutdown();  }
@Test public void testProcessSucceed() throws Exception { final TriggerInstance triggerInstance = createTriggerInstance(); this.processor.processSucceed(triggerInstance); this.submitFlowLatch.await(10L, TimeUnit.SECONDS); verify(this.executorManager).submitExecutableFlow(any(), anyString()); this.updateExecIDLatch.await(10L, TimeUnit.SECONDS); verify(this.triggerInstLoader).updateAssociatedFlowExecId(triggerInstance); }