Class AssetManagerTestBase
java.lang.Object
org.odpi.openmetadata.accessservices.assetmanager.fvt.common.AssetManagerTestBase
- Direct Known Subclasses:
ClientConstructorTest
,CreateExchangeGlossaryTest
,CreateManagementGlossaryTest
,ManageExternalIdsTest
AssetManagerTestBase provides common functions for test cases.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getAssetManager
(String assetManagerName, String serverName, String serverPlatformRootURL, String userId, AuditLog auditLog, String testCaseName) Create an asset manager entity and return its GUID.protected ExternalAssetManagerClient
getAssetManagerClient
(String serverName, String serverPlatformRootURL, AuditLog auditLog, String testCaseName) Create and return an asset manager client.protected String
getGlossary
(GlossaryExchangeClient client, String testCaseName, String activityName, String userId, String assetManagerGUID, String assetManagerName, String glossaryName, String glossaryDisplayName, String glossaryDescription, String glossaryUsage, String glossaryLanguage, String glossaryExternalIdentifier, String glossaryExternalIdentifierName, String glossaryExternalIdentifierUsage, String glossaryExternalIdentifierSource, KeyPattern glossaryExternalIdentifierKeyPattern, Map<String, String> mappingProperties) Create a new glossary object.protected String
getGlossary
(GlossaryManagementClient client, String testCaseName, String activityName, String userId, String glossaryName, String glossaryDisplayName, String glossaryDescription, String glossaryUsage, String glossaryLanguage) Create a new glossary object.protected GlossaryExchangeClient
getGlossaryExchangeClient
(String serverName, String serverPlatformRootURL, AuditLog auditLog, String testCaseName) Create and return a glossary exchange client.protected GlossaryManagementClient
getGlossaryManagementClient
(String serverName, String serverPlatformRootURL, AuditLog auditLog, String testCaseName) Create and return a glossary management client.protected void
validateCorrelationHeader
(List<MetadataCorrelationHeader> metadataCorrelationHeaders, String testCaseName, String activityName, String assetManagerGUID, String assetManagerName, String glossaryExternalIdentifier, String glossaryExternalIdentifierName, String glossaryExternalIdentifierUsage, String glossaryExternalIdentifierSource, KeyPattern glossaryExternalIdentifierKeyPattern, Map<String, String> mappingProperties, int expectedNumberOfIdentifiers) protected void
validateElementHeader
(ElementHeader elementHeader, String testCaseName, String activityName, String guid, String typeName) protected void
validateGlossaryProperties
(GlossaryProperties glossaryProperties, String testCaseName, String activityName, String glossaryName, String glossaryDisplayName, String glossaryDescription, String glossaryUsage, String glossaryLanguage) protected boolean
validateGlossaryTermElement
(String testCaseName, String activityName, String stepName, GlossaryTermElement retrievedElement, String glossaryTermGUID, String typeName, String qualifiedName, String displayName, String description, Map<String, Object> extendedProperties, ElementStatus status) Verify that an element returned is as expected.protected void
validateGlossaryTermElements
(String testCaseName, String activityName, String stepName, List<GlossaryTermElement> retrievedElements, String glossaryTermGUID, String typeName, String qualifiedName, String displayName, String description, Map<String, Object> extendedProperties, ElementStatus status) Validate a returned list of glossary term elements.
-
Field Details
-
maxPageSize
protected static final int maxPageSize- See Also:
-
GLOSSARY_TYPE_NAME
- See Also:
-
-
Constructor Details
-
AssetManagerTestBase
public AssetManagerTestBase()
-
-
Method Details
-
getAssetManagerClient
protected ExternalAssetManagerClient getAssetManagerClient(String serverName, String serverPlatformRootURL, AuditLog auditLog, String testCaseName) throws FVTUnexpectedCondition Create and return an asset manager client.- Parameters:
serverName
- name of the server to connect toserverPlatformRootURL
- the network address of the server running the OMAS REST serversauditLog
- logging destinationtestCaseName
- name of calling test case- Returns:
- client
- Throws:
FVTUnexpectedCondition
- the test case failed
-
getGlossaryExchangeClient
protected GlossaryExchangeClient getGlossaryExchangeClient(String serverName, String serverPlatformRootURL, AuditLog auditLog, String testCaseName) throws FVTUnexpectedCondition Create and return a glossary exchange client.- Parameters:
serverName
- name of the server to connect toserverPlatformRootURL
- the network address of the server running the OMAS REST serversauditLog
- logging destinationtestCaseName
- name of calling test case- Returns:
- client
- Throws:
FVTUnexpectedCondition
- the test case failed
-
getGlossaryManagementClient
protected GlossaryManagementClient getGlossaryManagementClient(String serverName, String serverPlatformRootURL, AuditLog auditLog, String testCaseName) throws FVTUnexpectedCondition Create and return a glossary management client.- Parameters:
serverName
- name of the server to connect toserverPlatformRootURL
- the network address of the server running the OMAS REST serversauditLog
- logging destinationtestCaseName
- name of calling test case- Returns:
- client
- Throws:
FVTUnexpectedCondition
- the test case failed
-
getAssetManager
protected String getAssetManager(String assetManagerName, String serverName, String serverPlatformRootURL, String userId, AuditLog auditLog, String testCaseName) throws FVTUnexpectedCondition Create an asset manager entity and return its GUID.- Parameters:
assetManagerName
- name of asset manager to useserverName
- name of the server to connect toserverPlatformRootURL
- the network address of the server running the OMAS REST serversuserId
- calling userauditLog
- logging destinationtestCaseName
- name of calling test case- Returns:
- unique identifier of the asset manager entity
- Throws:
FVTUnexpectedCondition
- the test case failed
-
validateCorrelationHeader
protected void validateCorrelationHeader(List<MetadataCorrelationHeader> metadataCorrelationHeaders, String testCaseName, String activityName, String assetManagerGUID, String assetManagerName, String glossaryExternalIdentifier, String glossaryExternalIdentifierName, String glossaryExternalIdentifierUsage, String glossaryExternalIdentifierSource, KeyPattern glossaryExternalIdentifierKeyPattern, Map<String, String> mappingProperties, int expectedNumberOfIdentifiers) throws FVTUnexpectedCondition- Throws:
FVTUnexpectedCondition
-
validateElementHeader
protected void validateElementHeader(ElementHeader elementHeader, String testCaseName, String activityName, String guid, String typeName) throws FVTUnexpectedCondition - Throws:
FVTUnexpectedCondition
-
validateGlossaryProperties
protected void validateGlossaryProperties(GlossaryProperties glossaryProperties, String testCaseName, String activityName, String glossaryName, String glossaryDisplayName, String glossaryDescription, String glossaryUsage, String glossaryLanguage) throws FVTUnexpectedCondition - Throws:
FVTUnexpectedCondition
-
getGlossary
protected String getGlossary(GlossaryExchangeClient client, String testCaseName, String activityName, String userId, String assetManagerGUID, String assetManagerName, String glossaryName, String glossaryDisplayName, String glossaryDescription, String glossaryUsage, String glossaryLanguage, String glossaryExternalIdentifier, String glossaryExternalIdentifierName, String glossaryExternalIdentifierUsage, String glossaryExternalIdentifierSource, KeyPattern glossaryExternalIdentifierKeyPattern, Map<String, String> mappingProperties) throws FVTUnexpectedConditionCreate a new glossary object. The identifier may be null. The glossary is retrieved and the return values tested to be sure the new element was created correctly.- Parameters:
client
- glossary clienttestCaseName
- calling test caseactivityName
- calling activity within the test caseuserId
- calling userassetManagerGUID
- unique identifier of asset manager to associate the identifier withassetManagerName
- unique name of asset manager to associate the identifier withglossaryName
- qualified name of glossaryglossaryDisplayName
- display name for glossaryglossaryDescription
- description of glossaryglossaryUsage
- expected usage of the glossaryglossaryLanguage
- language used in the glossaryglossaryExternalIdentifier
- external identifier used in third party technologyglossaryExternalIdentifierName
- name of external identifier used in third party technologyglossaryExternalIdentifierUsage
- usage of external identifier used in third party technologyglossaryExternalIdentifierSource
- source of external identifier used in third party technologyglossaryExternalIdentifierKeyPattern
- key pattern for external identifier used in third party technologymappingProperties
- additional mapping properties for external identifier used in third party technology- Returns:
- unique identifier of the new glossary
- Throws:
FVTUnexpectedCondition
- error
-
getGlossary
protected String getGlossary(GlossaryManagementClient client, String testCaseName, String activityName, String userId, String glossaryName, String glossaryDisplayName, String glossaryDescription, String glossaryUsage, String glossaryLanguage) throws FVTUnexpectedCondition Create a new glossary object. The identifier may be null. The glossary is retrieved and the return values tested to be sure the new element was created correctly.- Parameters:
client
- glossary clienttestCaseName
- calling test caseactivityName
- calling activity within the test caseuserId
- calling userglossaryName
- qualified name of glossaryglossaryDisplayName
- display name for glossaryglossaryDescription
- description of glossaryglossaryUsage
- expected usage of the glossaryglossaryLanguage
- language used in the glossary- Returns:
- unique identifier of the new glossary
- Throws:
FVTUnexpectedCondition
- error
-
validateGlossaryTermElement
protected boolean validateGlossaryTermElement(String testCaseName, String activityName, String stepName, GlossaryTermElement retrievedElement, String glossaryTermGUID, String typeName, String qualifiedName, String displayName, String description, Map<String, Object> extendedProperties, ElementStatus status) throws FVTUnexpectedConditionVerify that an element returned is as expected.- Parameters:
testCaseName
- calling test caseactivityName
- which teststepName
- which step in testretrievedElement
- element to testglossaryTermGUID
- guid of element of interesttypeName
- name of type of glossary termqualifiedName
- expected qualified namedisplayName
- expected display namedescription
- expected descriptionextendedProperties
- additional properties for subtypestatus
- expected status- Returns:
- boolean to indicate that the element matched the supplied GUID
- Throws:
FVTUnexpectedCondition
- something was wrong.
-
validateGlossaryTermElements
protected void validateGlossaryTermElements(String testCaseName, String activityName, String stepName, List<GlossaryTermElement> retrievedElements, String glossaryTermGUID, String typeName, String qualifiedName, String displayName, String description, Map<String, Object> extendedProperties, ElementStatus status) throws FVTUnexpectedConditionValidate a returned list of glossary term elements.- Parameters:
testCaseName
- calling test caseactivityName
- which teststepName
- which step in testretrievedElements
- elements retrieved from the repositoryglossaryTermGUID
- unique identifier of the element to focus ontypeName
- name of type of glossary termqualifiedName
- expected qualified namedisplayName
- expected display namedescription
- expected descriptionextendedProperties
- additional properties for subtypestatus
- expected status- Throws:
FVTUnexpectedCondition
- something was wrong.
-