@Test void createSchemaType_ResponseWithCapturedUserNotAuthorizedException() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { String methodName = "createOrUpdateSchemaType"; mockSchemaTypeHandler(methodName); UserNotAuthorizedException mockedException = mockException(UserNotAuthorizedException.class, methodName); when(dataEngineSchemaTypeHandler.createOrUpdateSchemaType(USER, getSchemaType(), EXTERNAL_SOURCE_DE_QUALIFIED_NAME)).thenThrow(mockedException); SchemaTypeRequestBody requestBody = mockSchemaTypeRequestBody(); GUIDResponse response = dataEngineRESTServices.createOrUpdateSchemaType(USER, SERVER_NAME, requestBody); verify(restExceptionHandler, times(1)).captureUserNotAuthorizedException(response, mockedException); }
public GUIDResponse createOrUpdateSchemaType(String userId, String serverName, SchemaTypeRequestBody schemaTypeRequestBody) { final String methodName = "createOrUpdateSchemaType"; GUIDResponse response = new GUIDResponse(); try { if (schemaTypeRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } String newSchemaTypeGUID = createOrUpdateSchemaType(userId, serverName, schemaTypeRequestBody.getSchemaType(), schemaTypeRequestBody.getExternalSourceName()); response.setGUID(newSchemaTypeGUID); } 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 createOrUpdateSchemaType(String userId, String serverName, SchemaTypeRequestBody schemaTypeRequestBody) { final String methodName = "createOrUpdateSchemaType"; GUIDResponse response = new GUIDResponse(); try { if (schemaTypeRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } String newSchemaTypeGUID = createOrUpdateSchemaType(userId, serverName, schemaTypeRequestBody.getSchemaType(), schemaTypeRequestBody.getExternalSourceName()); response.setGUID(newSchemaTypeGUID); } 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 createOrUpdateSchemaType(String userId, String serverName, SchemaTypeRequestBody schemaTypeRequestBody) { final String methodName = "createOrUpdateSchemaType"; GUIDResponse response = new GUIDResponse(); try { if (schemaTypeRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } String newSchemaTypeGUID = createOrUpdateSchemaType(userId, serverName, schemaTypeRequestBody.getSchemaType(), schemaTypeRequestBody.getExternalSourceName()); response.setGUID(newSchemaTypeGUID); } 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 createOrUpdateSchemaType(String userId, String serverName, SchemaTypeRequestBody schemaTypeRequestBody) { final String methodName = "createOrUpdateSchemaType"; GUIDResponse response = new GUIDResponse(); try { if (schemaTypeRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } String newSchemaTypeGUID = createOrUpdateSchemaType(userId, serverName, schemaTypeRequestBody.getSchemaType(), schemaTypeRequestBody.getExternalSourceName()); response.setGUID(newSchemaTypeGUID); } 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 createOrUpdateSchemaType(String userId, String serverName, SchemaTypeRequestBody schemaTypeRequestBody) { final String methodName = "createOrUpdateSchemaType"; GUIDResponse response = new GUIDResponse(); try { if (schemaTypeRequestBody == null) { restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); return response; } String newSchemaTypeGUID = createOrUpdateSchemaType(userId, serverName, schemaTypeRequestBody.getSchemaType(), schemaTypeRequestBody.getExternalSourceName()); response.setGUID(newSchemaTypeGUID); } 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; }