@Test public void testGetProcessGroupWithoutChildren() { final String flowId = "1"; when(flowManager.getFlow(flowId)).thenReturn(Optional.of(flow)); final FDProcessGroupFlow processGroupFlow = processGroupFlowService.get(flowId, flowContent.getIdentifier(), false); assertNotNull(processGroupFlow); final FDProcessGroupFlowContent processGroupFlowContent = processGroupFlow.getFlowContent(); assertEquals(0, processGroupFlowContent.getProcessGroups().size()); }
@Override public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren) { final Optional<FDFlow> flowOptional = flowManager.getFlow(flowId); if (!flowOptional.isPresent()) { throw new ResourceNotFoundException("A flow does not exist with the given id"); } final FDFlow flow = flowOptional.get(); final FDFlowMetadata flowMetadata = flow.getFlowMetadata(); final VersionedProcessGroup flowContents = flow.getFlowContent(); final FDVersionInfo versionInfo = flow.getVersionInfo(); final BigInteger localFlowRevision = flow.getLocalFlowRevision(); final VersionedProcessGroup versionedProcessGroup = ROOT_GROUP_ID.equals(processGroupId) ? flowContents : ComponentUtils.getProcessGroupOrNotFound(processGroupId, flowContents); final FDProcessGroupFlowContent processGroupFlowConfig = createProcessGroupFlowConfig(flow, versionedProcessGroup, includeChildren); final FDProcessGroupFlow processGroupFlow = new FDProcessGroupFlow(); processGroupFlow.setFlowContent(processGroupFlowConfig); processGroupFlow.setFlowMetadata(flowMetadata); processGroupFlow.setVersionInfo(versionInfo); processGroupFlow.setLocalFlowRevision(localFlowRevision); return processGroupFlow; }
StandardFDProcessGroupFlowService implements FDProcessGroupFlowService { @Override public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren) { final Optional<FDFlow> flowOptional = flowManager.getFlow(flowId); if (!flowOptional.isPresent()) { throw new ResourceNotFoundException("A flow does not exist with the given id"); } final FDFlow flow = flowOptional.get(); final FDFlowMetadata flowMetadata = flow.getFlowMetadata(); final VersionedProcessGroup flowContents = flow.getFlowContent(); final FDVersionInfo versionInfo = flow.getVersionInfo(); final BigInteger localFlowRevision = flow.getLocalFlowRevision(); final VersionedProcessGroup versionedProcessGroup = ROOT_GROUP_ID.equals(processGroupId) ? flowContents : ComponentUtils.getProcessGroupOrNotFound(processGroupId, flowContents); final FDProcessGroupFlowContent processGroupFlowConfig = createProcessGroupFlowConfig(flow, versionedProcessGroup, includeChildren); final FDProcessGroupFlow processGroupFlow = new FDProcessGroupFlow(); processGroupFlow.setFlowContent(processGroupFlowConfig); processGroupFlow.setFlowMetadata(flowMetadata); processGroupFlow.setVersionInfo(versionInfo); processGroupFlow.setLocalFlowRevision(localFlowRevision); return processGroupFlow; } }
StandardFDProcessGroupFlowService implements FDProcessGroupFlowService { @Override public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren) { final Optional<FDFlow> flowOptional = flowManager.getFlow(flowId); if (!flowOptional.isPresent()) { throw new ResourceNotFoundException("A flow does not exist with the given id"); } final FDFlow flow = flowOptional.get(); final FDFlowMetadata flowMetadata = flow.getFlowMetadata(); final VersionedProcessGroup flowContents = flow.getFlowContent(); final FDVersionInfo versionInfo = flow.getVersionInfo(); final BigInteger localFlowRevision = flow.getLocalFlowRevision(); final VersionedProcessGroup versionedProcessGroup = ROOT_GROUP_ID.equals(processGroupId) ? flowContents : ComponentUtils.getProcessGroupOrNotFound(processGroupId, flowContents); final FDProcessGroupFlowContent processGroupFlowConfig = createProcessGroupFlowConfig(flow, versionedProcessGroup, includeChildren); final FDProcessGroupFlow processGroupFlow = new FDProcessGroupFlow(); processGroupFlow.setFlowContent(processGroupFlowConfig); processGroupFlow.setFlowMetadata(flowMetadata); processGroupFlow.setVersionInfo(versionInfo); processGroupFlow.setLocalFlowRevision(localFlowRevision); return processGroupFlow; } @Autowired  StandardFDProcessGroupFlowService(final FDFlowManager flowManager,
                                             final FDProcessorService processorService,
                                             final FDControllerServiceService controllerServiceService,
                                             final ValidationService validationService,
                                             final ControllerServiceLookup serviceLookup); }
StandardFDProcessGroupFlowService implements FDProcessGroupFlowService { @Override public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren) { final Optional<FDFlow> flowOptional = flowManager.getFlow(flowId); if (!flowOptional.isPresent()) { throw new ResourceNotFoundException("A flow does not exist with the given id"); } final FDFlow flow = flowOptional.get(); final FDFlowMetadata flowMetadata = flow.getFlowMetadata(); final VersionedProcessGroup flowContents = flow.getFlowContent(); final FDVersionInfo versionInfo = flow.getVersionInfo(); final BigInteger localFlowRevision = flow.getLocalFlowRevision(); final VersionedProcessGroup versionedProcessGroup = ROOT_GROUP_ID.equals(processGroupId) ? flowContents : ComponentUtils.getProcessGroupOrNotFound(processGroupId, flowContents); final FDProcessGroupFlowContent processGroupFlowConfig = createProcessGroupFlowConfig(flow, versionedProcessGroup, includeChildren); final FDProcessGroupFlow processGroupFlow = new FDProcessGroupFlow(); processGroupFlow.setFlowContent(processGroupFlowConfig); processGroupFlow.setFlowMetadata(flowMetadata); processGroupFlow.setVersionInfo(versionInfo); processGroupFlow.setLocalFlowRevision(localFlowRevision); return processGroupFlow; } @Autowired  StandardFDProcessGroupFlowService(final FDFlowManager flowManager,
                                             final FDProcessorService processorService,
                                             final FDControllerServiceService controllerServiceService,
                                             final ValidationService validationService,
                                             final ControllerServiceLookup serviceLookup); @Override FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren); }
StandardFDProcessGroupFlowService implements FDProcessGroupFlowService { @Override public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren) { final Optional<FDFlow> flowOptional = flowManager.getFlow(flowId); if (!flowOptional.isPresent()) { throw new ResourceNotFoundException("A flow does not exist with the given id"); } final FDFlow flow = flowOptional.get(); final FDFlowMetadata flowMetadata = flow.getFlowMetadata(); final VersionedProcessGroup flowContents = flow.getFlowContent(); final FDVersionInfo versionInfo = flow.getVersionInfo(); final BigInteger localFlowRevision = flow.getLocalFlowRevision(); final VersionedProcessGroup versionedProcessGroup = ROOT_GROUP_ID.equals(processGroupId) ? flowContents : ComponentUtils.getProcessGroupOrNotFound(processGroupId, flowContents); final FDProcessGroupFlowContent processGroupFlowConfig = createProcessGroupFlowConfig(flow, versionedProcessGroup, includeChildren); final FDProcessGroupFlow processGroupFlow = new FDProcessGroupFlow(); processGroupFlow.setFlowContent(processGroupFlowConfig); processGroupFlow.setFlowMetadata(flowMetadata); processGroupFlow.setVersionInfo(versionInfo); processGroupFlow.setLocalFlowRevision(localFlowRevision); return processGroupFlow; } @Autowired  StandardFDProcessGroupFlowService(final FDFlowManager flowManager,
                                             final FDProcessorService processorService,
                                             final FDControllerServiceService controllerServiceService,
                                             final ValidationService validationService,
                                             final ControllerServiceLookup serviceLookup); @Override FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren); static final String ROOT_GROUP_ID; }