@Test public void isFlowPendingButNoPending() { List<FlowLog> flowLogs = new ArrayList<>(); FlowLog successfulFlowLog1 = new FlowLog(); successfulFlowLog1.setStateStatus(StateStatus.SUCCESSFUL); successfulFlowLog1.setNextEvent("NEXT_EVENT1"); successfulFlowLog1.setCreated(1L); successfulFlowLog1.setCurrentState("CURRENT_STATE1"); flowLogs.add(successfulFlowLog1); FlowLog failedFlowLog2 = new FlowLog(); failedFlowLog2.setStateStatus(StateStatus.FAILED); failedFlowLog2.setCurrentState("FAILED_CURRENT_STATE2"); failedFlowLog2.setCreated(5L); flowLogs.add(failedFlowLog2); FlowLog successfulFlowLog4 = new FlowLog(); successfulFlowLog4.setStateStatus(StateStatus.SUCCESSFUL); successfulFlowLog4.setNextEvent("NEXT_EVENT3"); successfulFlowLog4.setCreated(4L); successfulFlowLog4.setCurrentState("CURRENT_STATE3"); flowLogs.add(successfulFlowLog4); FlowLog successfulFlowLog3 = new FlowLog(); successfulFlowLog3.setStateStatus(StateStatus.SUCCESSFUL); successfulFlowLog3.setNextEvent("NEXT_EVENT1"); successfulFlowLog3.setCreated(3L); successfulFlowLog3.setCurrentState("CURRENT_STATE1"); flowLogs.add(successfulFlowLog3); FlowLog failedFlowLog = new FlowLog(); failedFlowLog.setStateStatus(StateStatus.FAILED); failedFlowLog.setCurrentState("FAILED_CURRENT_STATE1"); failedFlowLog.setCreated(2L); flowLogs.add(failedFlowLog); assertFalse(FlowRetryUtil.isFlowPending(flowLogs)); }
public static boolean isFlowPending(List<FlowLog> flowLogs) { return flowLogs.stream() .anyMatch(fl -> StateStatus.PENDING.equals(fl.getStateStatus())); }
FlowRetryUtil { public static boolean isFlowPending(List<FlowLog> flowLogs) { return flowLogs.stream() .anyMatch(fl -> StateStatus.PENDING.equals(fl.getStateStatus())); } }
FlowRetryUtil { public static boolean isFlowPending(List<FlowLog> flowLogs) { return flowLogs.stream() .anyMatch(fl -> StateStatus.PENDING.equals(fl.getStateStatus())); } private  FlowRetryUtil(); }
FlowRetryUtil { public static boolean isFlowPending(List<FlowLog> flowLogs) { return flowLogs.stream() .anyMatch(fl -> StateStatus.PENDING.equals(fl.getStateStatus())); } private  FlowRetryUtil(); static FlowLog getLastSuccessfulStateLog(String failedState, List<FlowLog> flowLogs); static Optional<FlowLog> getMostRecentFailedLog(List<FlowLog> flowLogs); static boolean isFlowPending(List<FlowLog> flowLogs); }
FlowRetryUtil { public static boolean isFlowPending(List<FlowLog> flowLogs) { return flowLogs.stream() .anyMatch(fl -> StateStatus.PENDING.equals(fl.getStateStatus())); } private  FlowRetryUtil(); static FlowLog getLastSuccessfulStateLog(String failedState, List<FlowLog> flowLogs); static Optional<FlowLog> getMostRecentFailedLog(List<FlowLog> flowLogs); static boolean isFlowPending(List<FlowLog> flowLogs);  }