@Test public void testRestartFlowNotRestartable() throws TransactionExecutionException { FlowLog flowLog = new FlowLog(STACK_ID, FLOW_ID, "START_STATE", true, StateStatus.SUCCESSFUL); flowLog.setFlowType(String.class); when(flowLogService.findFirstByFlowIdOrderByCreatedDesc(FLOW_ID)).thenReturn(Optional.of(flowLog)); underTest.restartFlow(FLOW_ID); verify(flowLogService, times(1)).terminate(STACK_ID, FLOW_ID); }
public void restartFlow(String flowId) { FlowLog flowLog = flowLogService.findFirstByFlowIdOrderByCreatedDesc(flowId).orElseThrow(() -> new FlowNotFoundException(flowId)); restartFlow(flowLog); }
Flow2Handler implements Consumer<Event<? extends Payload>> { public void restartFlow(String flowId) { FlowLog flowLog = flowLogService.findFirstByFlowIdOrderByCreatedDesc(flowId).orElseThrow(() -> new FlowNotFoundException(flowId)); restartFlow(flowLog); } }
Flow2Handler implements Consumer<Event<? extends Payload>> { public void restartFlow(String flowId) { FlowLog flowLog = flowLogService.findFirstByFlowIdOrderByCreatedDesc(flowId).orElseThrow(() -> new FlowNotFoundException(flowId)); restartFlow(flowLog); }  }
Flow2Handler implements Consumer<Event<? extends Payload>> { public void restartFlow(String flowId) { FlowLog flowLog = flowLogService.findFirstByFlowIdOrderByCreatedDesc(flowId).orElseThrow(() -> new FlowNotFoundException(flowId)); restartFlow(flowLog); }  @Override void accept(Event<? extends Payload> event); void cancelFlow(Long stackId, String flowId); void restartFlow(String flowId); void restartFlow(FlowLog flowLog); }
Flow2Handler implements Consumer<Event<? extends Payload>> { public void restartFlow(String flowId) { FlowLog flowLog = flowLogService.findFirstByFlowIdOrderByCreatedDesc(flowId).orElseThrow(() -> new FlowNotFoundException(flowId)); restartFlow(flowLog); }  @Override void accept(Event<? extends Payload> event); void cancelFlow(Long stackId, String flowId); void restartFlow(String flowId); void restartFlow(FlowLog flowLog); static final String FLOW_ID; static final String FLOW_CHAIN_ID; static final String FLOW_FINAL; static final String FLOW_CANCEL; }