@Test void addPortsToProcess_ResponseWithCapturedInvalidParameterException() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { String methodName = "addPortsToProcess"; mockProcessHandler(methodName); mockPortHandler(methodName); PortListRequestBody requestBody = mockPortListRequestBody(); Optional<EntityDetail> portEntity = mockEntityDetail(GUID); when(portHandler.findPortEntity(USER, QUALIFIED_NAME)).thenReturn(portEntity); InvalidParameterException mockedException = mockException(InvalidParameterException.class, methodName); doThrow(mockedException).when(processHandler).addProcessPortRelationship(USER, PROCESS_GUID, GUID, EXTERNAL_SOURCE_DE_QUALIFIED_NAME); GUIDResponse response = dataEngineRESTServices.addPortsToProcess(USER, SERVER_NAME, PROCESS_GUID, requestBody); verify(restExceptionHandler, times(1)).captureInvalidParameterException(response, mockedException); }
public void addPortsToProcess(String userId, String serverName, String processGUID, List<String> portQualifiedNames, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addPortsToProcess"; if (CollectionUtils.isEmpty(portQualifiedNames)) { return; } ProcessHandler processHandler = instanceHandler.getProcessHandler(userId, serverName, methodName); PortHandler portHandler = instanceHandler.getPortHandler(userId, serverName, methodName); for (String portQualifiedName : portQualifiedNames) { Optional<EntityDetail> portEntity = portHandler.findPortEntity(userId, portQualifiedName); if (portEntity.isPresent()) { processHandler.addProcessPortRelationship(userId, processGUID, portEntity.get().getGUID(), externalSourceName); } } }
DataEngineRESTServices { public void addPortsToProcess(String userId, String serverName, String processGUID, List<String> portQualifiedNames, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addPortsToProcess"; if (CollectionUtils.isEmpty(portQualifiedNames)) { return; } ProcessHandler processHandler = instanceHandler.getProcessHandler(userId, serverName, methodName); PortHandler portHandler = instanceHandler.getPortHandler(userId, serverName, methodName); for (String portQualifiedName : portQualifiedNames) { Optional<EntityDetail> portEntity = portHandler.findPortEntity(userId, portQualifiedName); if (portEntity.isPresent()) { processHandler.addProcessPortRelationship(userId, processGUID, portEntity.get().getGUID(), externalSourceName); } } } }
DataEngineRESTServices { public void addPortsToProcess(String userId, String serverName, String processGUID, List<String> portQualifiedNames, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addPortsToProcess"; if (CollectionUtils.isEmpty(portQualifiedNames)) { return; } ProcessHandler processHandler = instanceHandler.getProcessHandler(userId, serverName, methodName); PortHandler portHandler = instanceHandler.getPortHandler(userId, serverName, methodName); for (String portQualifiedName : portQualifiedNames) { Optional<EntityDetail> portEntity = portHandler.findPortEntity(userId, portQualifiedName); if (portEntity.isPresent()) { processHandler.addProcessPortRelationship(userId, processGUID, portEntity.get().getGUID(), externalSourceName); } } }  }
DataEngineRESTServices { public void addPortsToProcess(String userId, String serverName, String processGUID, List<String> portQualifiedNames, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addPortsToProcess"; if (CollectionUtils.isEmpty(portQualifiedNames)) { return; } ProcessHandler processHandler = instanceHandler.getProcessHandler(userId, serverName, methodName); PortHandler portHandler = instanceHandler.getPortHandler(userId, serverName, methodName); for (String portQualifiedName : portQualifiedNames) { Optional<EntityDetail> portEntity = portHandler.findPortEntity(userId, portQualifiedName); if (portEntity.isPresent()) { processHandler.addProcessPortRelationship(userId, processGUID, portEntity.get().getGUID(), externalSourceName); } } }  GUIDResponse createExternalDataEngine(String serverName, String userId,
                                                 DataEngineRegistrationRequestBody requestBody); GUIDResponse getExternalDataEngineByQualifiedName(String serverName, String userId, String qualifiedName); GUIDResponse createOrUpdateSchemaType(String userId, String serverName, SchemaTypeRequestBody schemaTypeRequestBody); GUIDResponse createOrUpdatePortImplementation(String userId, String serverName,
                                                         PortImplementationRequestBody portImplementationRequestBody); GUIDResponse createOrUpdatePortAlias(String userId, String serverName, PortAliasRequestBody portAliasRequestBody); ProcessListResponse createOrUpdateProcesses(String userId, String serverName, ProcessesRequestBody processesRequestBody); String createOrUpdatePortAliasWithDelegation(String userId, String serverName, PortAlias portAlias, String externalSourceName); String createOrUpdatePortImplementationWithSchemaType(String userId, String serverName, PortImplementation portImplementation,
                                                                 String externalSourceName); String createExternalDataEngine(String userId, String serverName, SoftwareServerCapability softwareServerCapability); void addPortsToProcess(String userId, String serverName, String processGUID, List<String> portQualifiedNames, String externalSourceName); void addLineageMappings(String userId, String serverName, List<LineageMapping> lineageMappings, FFDCResponseBase response,
                                   String externalSourceName); ProcessListResponse createOrUpdateProcesses(String userId, String serverName, List<Process> processes, String externalSourceName); GUIDResponse addPortsToProcess(String userId, String serverName, String processGuid, PortListRequestBody portListRequestBody); VoidResponse addLineageMappings(String userId, String serverName, LineageMappingsRequestBody lineageMappingsRequestBody); ConnectionResponse getInTopicConnection(String serverName, String userId); String createOrUpdateSchemaType(String userId, String serverName, SchemaType schemaType, String externalSourceName); }
DataEngineRESTServices { public void addPortsToProcess(String userId, String serverName, String processGUID, List<String> portQualifiedNames, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addPortsToProcess"; if (CollectionUtils.isEmpty(portQualifiedNames)) { return; } ProcessHandler processHandler = instanceHandler.getProcessHandler(userId, serverName, methodName); PortHandler portHandler = instanceHandler.getPortHandler(userId, serverName, methodName); for (String portQualifiedName : portQualifiedNames) { Optional<EntityDetail> portEntity = portHandler.findPortEntity(userId, portQualifiedName); if (portEntity.isPresent()) { processHandler.addProcessPortRelationship(userId, processGUID, portEntity.get().getGUID(), externalSourceName); } } }  GUIDResponse createExternalDataEngine(String serverName, String userId,
                                                 DataEngineRegistrationRequestBody requestBody); GUIDResponse getExternalDataEngineByQualifiedName(String serverName, String userId, String qualifiedName); GUIDResponse createOrUpdateSchemaType(String userId, String serverName, SchemaTypeRequestBody schemaTypeRequestBody); GUIDResponse createOrUpdatePortImplementation(String userId, String serverName,
                                                         PortImplementationRequestBody portImplementationRequestBody); GUIDResponse createOrUpdatePortAlias(String userId, String serverName, PortAliasRequestBody portAliasRequestBody); ProcessListResponse createOrUpdateProcesses(String userId, String serverName, ProcessesRequestBody processesRequestBody); String createOrUpdatePortAliasWithDelegation(String userId, String serverName, PortAlias portAlias, String externalSourceName); String createOrUpdatePortImplementationWithSchemaType(String userId, String serverName, PortImplementation portImplementation,
                                                                 String externalSourceName); String createExternalDataEngine(String userId, String serverName, SoftwareServerCapability softwareServerCapability); void addPortsToProcess(String userId, String serverName, String processGUID, List<String> portQualifiedNames, String externalSourceName); void addLineageMappings(String userId, String serverName, List<LineageMapping> lineageMappings, FFDCResponseBase response,
                                   String externalSourceName); ProcessListResponse createOrUpdateProcesses(String userId, String serverName, List<Process> processes, String externalSourceName); GUIDResponse addPortsToProcess(String userId, String serverName, String processGuid, PortListRequestBody portListRequestBody); VoidResponse addLineageMappings(String userId, String serverName, LineageMappingsRequestBody lineageMappingsRequestBody); ConnectionResponse getInTopicConnection(String serverName, String userId); String createOrUpdateSchemaType(String userId, String serverName, SchemaType schemaType, String externalSourceName); static final String EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING; static final String EXCEPTION_WHILE_CREATING_PROCESS; static final String EXCEPTION_WHILE_CREATING_PROCESS_HIERARCHY; }