@Test void updatePortAlias() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { mockPortHandler("createOrUpdatePortAliasWithDelegation"); Optional<EntityDetail> portEntity = mockEntityDetail(GUID); when(portHandler.findPortAliasEntity(USER, QUALIFIED_NAME)).thenReturn(portEntity); PortAliasRequestBody requestBody = mockPortAliasRequestBody(); GUIDResponse response = dataEngineRESTServices.createOrUpdatePortAlias(USER, SERVER_NAME, requestBody); assertEquals(GUID, response.getGUID()); verify(portHandler, times(1)).updatePortAlias(USER, portEntity.get(), portAlias); verify(portHandler, times(1)).addPortDelegationRelationship(USER, GUID, PortType.INOUT_PORT, DELEGATED_QUALIFIED_NAME, EXTERNAL_SOURCE_DE_QUALIFIED_NAME); }
public GUIDResponse createOrUpdatePortAlias(String userId, String serverName, PortAliasRequestBody portAliasRequestBody) { final String methodName = "createOrUpdatePortAliasWithDelegation"; GUIDResponse response = new GUIDResponse(); try { if (portAliasRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } response.setGUID(createOrUpdatePortAliasWithDelegation(userId, serverName, portAliasRequestBody.getPortAlias(), portAliasRequestBody.getExternalSourceName())); } catch (InvalidParameterException error) { restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { restExceptionHandler.captureUserNotAuthorizedException(response, error); } return response; }
DataEngineRESTServices { public GUIDResponse createOrUpdatePortAlias(String userId, String serverName, PortAliasRequestBody portAliasRequestBody) { final String methodName = "createOrUpdatePortAliasWithDelegation"; GUIDResponse response = new GUIDResponse(); try { if (portAliasRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } response.setGUID(createOrUpdatePortAliasWithDelegation(userId, serverName, portAliasRequestBody.getPortAlias(), portAliasRequestBody.getExternalSourceName())); } catch (InvalidParameterException error) { restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { restExceptionHandler.captureUserNotAuthorizedException(response, error); } return response; } }
DataEngineRESTServices { public GUIDResponse createOrUpdatePortAlias(String userId, String serverName, PortAliasRequestBody portAliasRequestBody) { final String methodName = "createOrUpdatePortAliasWithDelegation"; GUIDResponse response = new GUIDResponse(); try { if (portAliasRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } response.setGUID(createOrUpdatePortAliasWithDelegation(userId, serverName, portAliasRequestBody.getPortAlias(), portAliasRequestBody.getExternalSourceName())); } catch (InvalidParameterException error) { restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { restExceptionHandler.captureUserNotAuthorizedException(response, error); } return response; }  }
DataEngineRESTServices { public GUIDResponse createOrUpdatePortAlias(String userId, String serverName, PortAliasRequestBody portAliasRequestBody) { final String methodName = "createOrUpdatePortAliasWithDelegation"; GUIDResponse response = new GUIDResponse(); try { if (portAliasRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } response.setGUID(createOrUpdatePortAliasWithDelegation(userId, serverName, portAliasRequestBody.getPortAlias(), portAliasRequestBody.getExternalSourceName())); } catch (InvalidParameterException error) { restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { restExceptionHandler.captureUserNotAuthorizedException(response, error); } return response; }  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 GUIDResponse createOrUpdatePortAlias(String userId, String serverName, PortAliasRequestBody portAliasRequestBody) { final String methodName = "createOrUpdatePortAliasWithDelegation"; GUIDResponse response = new GUIDResponse(); try { if (portAliasRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } response.setGUID(createOrUpdatePortAliasWithDelegation(userId, serverName, portAliasRequestBody.getPortAlias(), portAliasRequestBody.getExternalSourceName())); } catch (InvalidParameterException error) { restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { restExceptionHandler.captureUserNotAuthorizedException(response, error); } return response; }  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; }