@Test void addLineageMappings_ResponseWithCapturedInvalidParameterException() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { String methodName = "addLineageMappings"; mockSchemaTypeHandler(methodName); LineageMappingsRequestBody requestBody = mockLineageMappingsRequestBody(); InvalidParameterException mockedException = mockException(InvalidParameterException.class, methodName); doThrow(mockedException).when(dataEngineSchemaTypeHandler).addLineageMappingRelationship(USER, SOURCE_QUALIFIED_NAME, TARGET_QUALIFIED_NAME, EXTERNAL_SOURCE_DE_QUALIFIED_NAME); VoidResponse response = dataEngineRESTServices.addLineageMappings(USER, SERVER_NAME, requestBody); verify(restExceptionHandler, times(1)).captureInvalidParameterException(response, mockedException); }
public void addLineageMappings(String userId, String serverName, List<LineageMapping> lineageMappings, FFDCResponseBase response, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addLineageMappings"; log.debug(DEBUG_MESSAGE_METHOD_DETAILS, methodName, lineageMappings); if (CollectionUtils.isEmpty(lineageMappings)) { return; } DataEngineSchemaTypeHandler dataEngineSchemaTypeHandler = instanceHandler.getDataEngineSchemaTypeHandler(userId, serverName, methodName); lineageMappings.parallelStream().forEach(lineageMapping -> { try { dataEngineSchemaTypeHandler.addLineageMappingRelationship(userId, lineageMapping.getSourceAttribute(), lineageMapping.getTargetAttribute(), externalSourceName); } catch (InvalidParameterException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureUserNotAuthorizedException(response, error); } }); }
DataEngineRESTServices { public void addLineageMappings(String userId, String serverName, List<LineageMapping> lineageMappings, FFDCResponseBase response, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addLineageMappings"; log.debug(DEBUG_MESSAGE_METHOD_DETAILS, methodName, lineageMappings); if (CollectionUtils.isEmpty(lineageMappings)) { return; } DataEngineSchemaTypeHandler dataEngineSchemaTypeHandler = instanceHandler.getDataEngineSchemaTypeHandler(userId, serverName, methodName); lineageMappings.parallelStream().forEach(lineageMapping -> { try { dataEngineSchemaTypeHandler.addLineageMappingRelationship(userId, lineageMapping.getSourceAttribute(), lineageMapping.getTargetAttribute(), externalSourceName); } catch (InvalidParameterException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureUserNotAuthorizedException(response, error); } }); } }
DataEngineRESTServices { public void addLineageMappings(String userId, String serverName, List<LineageMapping> lineageMappings, FFDCResponseBase response, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addLineageMappings"; log.debug(DEBUG_MESSAGE_METHOD_DETAILS, methodName, lineageMappings); if (CollectionUtils.isEmpty(lineageMappings)) { return; } DataEngineSchemaTypeHandler dataEngineSchemaTypeHandler = instanceHandler.getDataEngineSchemaTypeHandler(userId, serverName, methodName); lineageMappings.parallelStream().forEach(lineageMapping -> { try { dataEngineSchemaTypeHandler.addLineageMappingRelationship(userId, lineageMapping.getSourceAttribute(), lineageMapping.getTargetAttribute(), externalSourceName); } catch (InvalidParameterException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureUserNotAuthorizedException(response, error); } }); }  }
DataEngineRESTServices { public void addLineageMappings(String userId, String serverName, List<LineageMapping> lineageMappings, FFDCResponseBase response, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addLineageMappings"; log.debug(DEBUG_MESSAGE_METHOD_DETAILS, methodName, lineageMappings); if (CollectionUtils.isEmpty(lineageMappings)) { return; } DataEngineSchemaTypeHandler dataEngineSchemaTypeHandler = instanceHandler.getDataEngineSchemaTypeHandler(userId, serverName, methodName); lineageMappings.parallelStream().forEach(lineageMapping -> { try { dataEngineSchemaTypeHandler.addLineageMappingRelationship(userId, lineageMapping.getSourceAttribute(), lineageMapping.getTargetAttribute(), externalSourceName); } catch (InvalidParameterException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureUserNotAuthorizedException(response, error); } }); }  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 addLineageMappings(String userId, String serverName, List<LineageMapping> lineageMappings, FFDCResponseBase response, String externalSourceName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { final String methodName = "addLineageMappings"; log.debug(DEBUG_MESSAGE_METHOD_DETAILS, methodName, lineageMappings); if (CollectionUtils.isEmpty(lineageMappings)) { return; } DataEngineSchemaTypeHandler dataEngineSchemaTypeHandler = instanceHandler.getDataEngineSchemaTypeHandler(userId, serverName, methodName); lineageMappings.parallelStream().forEach(lineageMapping -> { try { dataEngineSchemaTypeHandler.addLineageMappingRelationship(userId, lineageMapping.getSourceAttribute(), lineageMapping.getTargetAttribute(), externalSourceName); } catch (InvalidParameterException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureInvalidParameterException(response, error); } catch (PropertyServerException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.capturePropertyServerException(response, error); } catch (UserNotAuthorizedException error) { log.error(EXCEPTION_WHILE_ADDING_LINEAGE_MAPPING, lineageMapping.toString(), error.toString()); restExceptionHandler.captureUserNotAuthorizedException(response, error); } }); }  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; }