@Test public void testGetLastFlowByIdException() { when(flowLogDBService.getLastFlowLog(anyString())).thenReturn(Optional.empty()); thrown.expect(BadRequestException.class); thrown.expectMessage("Not found flow for this flow id!"); underTest.getLastFlowById(FLOW_ID); verify(flowLogDBService).getLastFlowLog(anyString()); verifyZeroInteractions(conversionService); }
public FlowLogResponse getLastFlowById(String flowId) { LOGGER.info("Getting last flow log by flow id {}", flowId); Optional<FlowLog> lastFlowLog = flowLogDBService.getLastFlowLog(flowId); if (lastFlowLog.isPresent()) { return conversionService.convert(lastFlowLog.get(), FlowLogResponse.class); } throw new BadRequestException("Not found flow for this flow id!"); }
FlowService { public FlowLogResponse getLastFlowById(String flowId) { LOGGER.info("Getting last flow log by flow id {}", flowId); Optional<FlowLog> lastFlowLog = flowLogDBService.getLastFlowLog(flowId); if (lastFlowLog.isPresent()) { return conversionService.convert(lastFlowLog.get(), FlowLogResponse.class); } throw new BadRequestException("Not found flow for this flow id!"); } }
FlowService { public FlowLogResponse getLastFlowById(String flowId) { LOGGER.info("Getting last flow log by flow id {}", flowId); Optional<FlowLog> lastFlowLog = flowLogDBService.getLastFlowLog(flowId); if (lastFlowLog.isPresent()) { return conversionService.convert(lastFlowLog.get(), FlowLogResponse.class); } throw new BadRequestException("Not found flow for this flow id!"); }  }
FlowService { public FlowLogResponse getLastFlowById(String flowId) { LOGGER.info("Getting last flow log by flow id {}", flowId); Optional<FlowLog> lastFlowLog = flowLogDBService.getLastFlowLog(flowId); if (lastFlowLog.isPresent()) { return conversionService.convert(lastFlowLog.get(), FlowLogResponse.class); } throw new BadRequestException("Not found flow for this flow id!"); }  FlowLogResponse getLastFlowById(String flowId); List<FlowLogResponse> getFlowLogsByFlowId(String flowId); FlowLogResponse getLastFlowByResourceName(String resourceName); FlowLogResponse getLastFlowByResourceCrn(String resourceCrn); List<FlowLogResponse> getFlowLogsByResourceCrn(String resourceCrn); List<FlowLogResponse> getFlowLogsByResourceName(String resourceName); FlowCheckResponse getFlowChainStateByResourceCrn(String chainId, String resourceCrn); FlowCheckResponse getFlowChainState(String chainId); FlowCheckResponse getFlowChainStateSafe(Long resourceId, String chainId); FlowCheckResponse getFlowState(String flowId); }
FlowService { public FlowLogResponse getLastFlowById(String flowId) { LOGGER.info("Getting last flow log by flow id {}", flowId); Optional<FlowLog> lastFlowLog = flowLogDBService.getLastFlowLog(flowId); if (lastFlowLog.isPresent()) { return conversionService.convert(lastFlowLog.get(), FlowLogResponse.class); } throw new BadRequestException("Not found flow for this flow id!"); }  FlowLogResponse getLastFlowById(String flowId); List<FlowLogResponse> getFlowLogsByFlowId(String flowId); FlowLogResponse getLastFlowByResourceName(String resourceName); FlowLogResponse getLastFlowByResourceCrn(String resourceCrn); List<FlowLogResponse> getFlowLogsByResourceCrn(String resourceCrn); List<FlowLogResponse> getFlowLogsByResourceName(String resourceName); FlowCheckResponse getFlowChainStateByResourceCrn(String chainId, String resourceCrn); FlowCheckResponse getFlowChainState(String chainId); FlowCheckResponse getFlowChainStateSafe(Long resourceId, String chainId); FlowCheckResponse getFlowState(String flowId);  }