@Test public void testGetGovernedAsset() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { when(instanceHandler.getGovernedAssetHandler(USER, SERVER_NAME, "getGovernedAsset")) .thenReturn(governedAssetHandler); GovernedAsset response = mockGovernedAsset(); when(governedAssetHandler .getGovernedAsset(USER, SCHEMA_ELEMENT_GUID)) .thenReturn(response); GovernedAssetResponse governedAssets = governanceEngineRESTServices.getGovernedAsset(SERVER_NAME, USER, SCHEMA_ELEMENT_GUID); assertEquals(response, governedAssets.getAsset()); }
public GovernedAssetResponse getGovernedAsset(String serverName, String userId, String assetGuid) { String methodName = "getGovernedAsset"; GovernedAssetResponse response = new GovernedAssetResponse(); try { GovernedAssetHandler governedAssetHandler = instanceHandler.getGovernedAssetHandler(userId, serverName, methodName); response.setAsset(governedAssetHandler.getGovernedAsset(userId, assetGuid)); } catch (InvalidParameterException e) { restExceptionHandler.captureInvalidParameterException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException e) { restExceptionHandler.captureUserNotAuthorizedException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) { restExceptionHandler.capturePropertyServerException(response, e); } return response; }
GovernanceEngineRESTServices { public GovernedAssetResponse getGovernedAsset(String serverName, String userId, String assetGuid) { String methodName = "getGovernedAsset"; GovernedAssetResponse response = new GovernedAssetResponse(); try { GovernedAssetHandler governedAssetHandler = instanceHandler.getGovernedAssetHandler(userId, serverName, methodName); response.setAsset(governedAssetHandler.getGovernedAsset(userId, assetGuid)); } catch (InvalidParameterException e) { restExceptionHandler.captureInvalidParameterException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException e) { restExceptionHandler.captureUserNotAuthorizedException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) { restExceptionHandler.capturePropertyServerException(response, e); } return response; } }
GovernanceEngineRESTServices { public GovernedAssetResponse getGovernedAsset(String serverName, String userId, String assetGuid) { String methodName = "getGovernedAsset"; GovernedAssetResponse response = new GovernedAssetResponse(); try { GovernedAssetHandler governedAssetHandler = instanceHandler.getGovernedAssetHandler(userId, serverName, methodName); response.setAsset(governedAssetHandler.getGovernedAsset(userId, assetGuid)); } catch (InvalidParameterException e) { restExceptionHandler.captureInvalidParameterException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException e) { restExceptionHandler.captureUserNotAuthorizedException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) { restExceptionHandler.capturePropertyServerException(response, e); } return response; }  }
GovernanceEngineRESTServices { public GovernedAssetResponse getGovernedAsset(String serverName, String userId, String assetGuid) { String methodName = "getGovernedAsset"; GovernedAssetResponse response = new GovernedAssetResponse(); try { GovernedAssetHandler governedAssetHandler = instanceHandler.getGovernedAssetHandler(userId, serverName, methodName); response.setAsset(governedAssetHandler.getGovernedAsset(userId, assetGuid)); } catch (InvalidParameterException e) { restExceptionHandler.captureInvalidParameterException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException e) { restExceptionHandler.captureUserNotAuthorizedException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) { restExceptionHandler.capturePropertyServerException(response, e); } return response; }  GovernedAssetListResponse getGovernedAssets(String serverName, String userId, List<String> entityTypes, Integer offset, Integer pageSize); GovernedAssetResponse getGovernedAsset(String serverName, String userId, String assetGuid); StringResponse createSoftwareServer(String serverName, String userId, SoftwareServerCapabilityRequestBody requestBody); SoftwareServerCapabilityResponse getSoftwareServerByGUID(String serverName, String userId, String guid); }
GovernanceEngineRESTServices { public GovernedAssetResponse getGovernedAsset(String serverName, String userId, String assetGuid) { String methodName = "getGovernedAsset"; GovernedAssetResponse response = new GovernedAssetResponse(); try { GovernedAssetHandler governedAssetHandler = instanceHandler.getGovernedAssetHandler(userId, serverName, methodName); response.setAsset(governedAssetHandler.getGovernedAsset(userId, assetGuid)); } catch (InvalidParameterException e) { restExceptionHandler.captureInvalidParameterException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException e) { restExceptionHandler.captureUserNotAuthorizedException(response, e); } catch (org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException e) { restExceptionHandler.capturePropertyServerException(response, e); } return response; }  GovernedAssetListResponse getGovernedAssets(String serverName, String userId, List<String> entityTypes, Integer offset, Integer pageSize); GovernedAssetResponse getGovernedAsset(String serverName, String userId, String assetGuid); StringResponse createSoftwareServer(String serverName, String userId, SoftwareServerCapabilityRequestBody requestBody); SoftwareServerCapabilityResponse getSoftwareServerByGUID(String serverName, String userId, String guid);  }