test_class.declarator: processorDefinition
test_class.modifier: private
test_class.original_string: private ProcessorDefinition processorDefinition;
test_class.type: ProcessorDefinition
test_class.var_name: processorDefinition
test_class.declarator: controllerServiceDefinition
test_class.modifier: private
test_class.original_string: private ControllerServiceDefinition controllerServiceDefinition;
test_class.type: ControllerServiceDefinition
test_class.var_name: controllerServiceDefinition
test_class.declarator: processorService
test_class.modifier: private
test_class.original_string: private FDProcessorService processorService;
test_class.type: FDProcessorService
test_class.var_name: processorService
test_class.declarator: controllerServiceService
test_class.modifier: private
test_class.original_string: private FDControllerServiceService controllerServiceService;
test_class.type: FDControllerServiceService
test_class.var_name: controllerServiceService
test_class.declarator: processGroupFlowService
test_class.modifier: private
test_class.original_string: private FDProcessGroupFlowService processGroupFlowService;
test_class.type: FDProcessGroupFlowService
test_class.var_name: processGroupFlowService
test_class.file: efm/efm-flow-designer/efm-flow-designer-framework/src/test/java/com/cloudera/cem/efm/service/component/TestStandardFDProcessGroupFlowService.java
test_class.identifier: TestStandardFDProcessGroupFlowService
test_class.superclass: extends BaseFDServiceTest
test_case.body: @Test
      public void testGetProcessGroupWithChildren() {
          final String flowId = "1";
          when(flowManager.getFlow(flowId)).thenReturn(Optional.of(flow));
  
          // We just want to prove that the service is populating the component definitions, so just return anything here
          when(processorService.getComponentDefinition(any(String.class), any(VersionedProcessor.class))).thenReturn(processorDefinition);
          when(controllerServiceService.getComponentDefinition(any(String.class), any(VersionedControllerService.class))).thenReturn(controllerServiceDefinition);
  
          final FDProcessGroupFlow processGroupFlow = processGroupFlowService.get(flowId, flowContent.getIdentifier(), true);
          assertNotNull(processGroupFlow);
  
          final FDProcessGroupFlowContent processGroupFlowContent = processGroupFlow.getFlowContent();
          assertTrue(processGroupFlowContent.getProcessGroups().size() > 0);
          assertEquals(flowContent.getProcessGroups().size(), processGroupFlowContent.getProcessGroups().size());
  
          final int totalProcessors = getNumberOfProcessors(processGroupFlowContent);
          assertEquals(5, totalProcessors);
  
          final int totalServices = getNumberOfControllerServices(processGroupFlowContent);
          assertEquals(1, totalServices);
      }
test_case.class_method_signature: TestStandardFDProcessGroupFlowService.testGetProcessGroupWithChildren()
test_case.full_signature: @Test public void testGetProcessGroupWithChildren()
test_case.identifier: testGetProcessGroupWithChildren
test_case.invocations: thenReturn when getFlow of thenReturn when getComponentDefinition any any thenReturn when getComponentDefinition any any get getIdentifier assertNotNull getFlowContent assertTrue size getProcessGroups assertEquals size getProcessGroups size getProcessGroups getNumberOfProcessors assertEquals getNumberOfControllerServices assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetProcessGroupWithChildren()
focal_class.declarator: ROOT_GROUP_ID = "root"
focal_class.modifier: public static final
focal_class.original_string: public static final String ROOT_GROUP_ID = "root";
focal_class.type: String
focal_class.var_name: ROOT_GROUP_ID
focal_class.declarator: flowManager
focal_class.modifier: private final
focal_class.original_string: private final FDFlowManager flowManager;
focal_class.type: FDFlowManager
focal_class.var_name: flowManager
focal_class.declarator: processorService
focal_class.modifier: private final
focal_class.original_string: private final FDProcessorService processorService;
focal_class.type: FDProcessorService
focal_class.var_name: processorService
focal_class.declarator: controllerServiceService
focal_class.modifier: private final
focal_class.original_string: private final FDControllerServiceService controllerServiceService;
focal_class.type: FDControllerServiceService
focal_class.var_name: controllerServiceService
focal_class.declarator: validationService
focal_class.modifier: private final
focal_class.original_string: private final ValidationService validationService;
focal_class.type: ValidationService
focal_class.var_name: validationService
focal_class.declarator: serviceLookup
focal_class.modifier: private final
focal_class.original_string: private final ControllerServiceLookup serviceLookup;
focal_class.type: ControllerServiceLookup
focal_class.var_name: serviceLookup
focal_class.file: efm/efm-flow-designer/efm-flow-designer-framework/src/main/java/com/cloudera/cem/efm/service/component/StandardFDProcessGroupFlowService.java
focal_class.identifier: StandardFDProcessGroupFlowService
focal_class.interfaces: implements FDProcessGroupFlowService
focal_class.class_method_signature: StandardFDProcessGroupFlowService.StandardFDProcessGroupFlowService(final FDFlowManager flowManager,
                                               final FDProcessorService processorService,
                                               final FDControllerServiceService controllerServiceService,
                                               final ValidationService validationService,
                                               final ControllerServiceLookup serviceLookup)
focal_class.full_signature: @Autowired public  StandardFDProcessGroupFlowService(final FDFlowManager flowManager,
                                               final FDProcessorService processorService,
                                               final FDControllerServiceService controllerServiceService,
                                               final ValidationService validationService,
                                               final ControllerServiceLookup serviceLookup)
focal_class.identifier: StandardFDProcessGroupFlowService
focal_class.modifiers: @Autowired public
focal_class.parameters: (final FDFlowManager flowManager,
                                               final FDProcessorService processorService,
                                               final FDControllerServiceService controllerServiceService,
                                               final ValidationService validationService,
                                               final ControllerServiceLookup serviceLookup)
focal_class.signature:  StandardFDProcessGroupFlowService(final FDFlowManager flowManager,
                                               final FDProcessorService processorService,
                                               final FDControllerServiceService controllerServiceService,
                                               final ValidationService validationService,
                                               final ControllerServiceLookup serviceLookup)
focal_class.class_method_signature: StandardFDProcessGroupFlowService.get(final String flowId, final String processGroupId, final boolean includeChildren)
focal_class.full_signature: @Override public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (final String flowId, final String processGroupId, final boolean includeChildren)
focal_class.return: FDProcessGroupFlow
focal_class.signature: FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren)
focal_class.class_method_signature: StandardFDProcessGroupFlowService.createProcessGroupFlowConfig(
              final FDFlow flow, final VersionedProcessGroup source, final boolean includeChildren)
focal_class.full_signature: private FDProcessGroupFlowContent createProcessGroupFlowConfig(
              final FDFlow flow, final VersionedProcessGroup source, final boolean includeChildren)
focal_class.identifier: createProcessGroupFlowConfig
focal_class.modifiers: private
focal_class.parameters: (
              final FDFlow flow, final VersionedProcessGroup source, final boolean includeChildren)
focal_class.return: FDProcessGroupFlowContent
focal_class.signature: FDProcessGroupFlowContent createProcessGroupFlowConfig(
              final FDFlow flow, final VersionedProcessGroup source, final boolean includeChildren)
focal_method.body: @Override
      public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren) {
          // Locate the flow where the process group is located
          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();
  
          // Locate the requested process group with in the flow, or throw an exception
          final VersionedProcessGroup versionedProcessGroup = ROOT_GROUP_ID.equals(processGroupId)
                  ? flowContents : ComponentUtils.getProcessGroupOrNotFound(processGroupId, flowContents);
  
          // Convert the VersionedProcessGroup to an FDProcessGroupFlowContent object
          final FDProcessGroupFlowContent processGroupFlowConfig = createProcessGroupFlowConfig(flow, versionedProcessGroup, includeChildren);
  
          // Create the overall process group flow to wrap metadata and content
          final FDProcessGroupFlow processGroupFlow = new FDProcessGroupFlow();
          processGroupFlow.setFlowContent(processGroupFlowConfig);
          processGroupFlow.setFlowMetadata(flowMetadata);
          processGroupFlow.setVersionInfo(versionInfo);
          processGroupFlow.setLocalFlowRevision(localFlowRevision);
          return  processGroupFlow;
      }
focal_method.class_method_signature: StandardFDProcessGroupFlowService.get(final String flowId, final String processGroupId, final boolean includeChildren)
focal_method.full_signature: @Override public FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren)
focal_method.identifier: get
focal_method.invocations: getFlow isPresent get getFlowMetadata getFlowContent getVersionInfo getLocalFlowRevision equals getProcessGroupOrNotFound createProcessGroupFlowConfig setFlowContent setFlowMetadata setVersionInfo setLocalFlowRevision
focal_method.modifiers: @Override public
focal_method.parameters: (final String flowId, final String processGroupId, final boolean includeChildren)
focal_method.return: FDProcessGroupFlow
focal_method.signature: FDProcessGroupFlow get(final String flowId, final String processGroupId, final boolean includeChildren)