java.lang.Object
org.odpi.openmetadata.accessservices.assetmanager.fvt.common.AssetManagerTestBase
Direct Known Subclasses:
ClientConstructorTest, CreateExchangeGlossaryTest, CreateManagementGlossaryTest, ManageExternalIdsTest

public class AssetManagerTestBase extends Object
AssetManagerTestBase provides common functions for test cases.
  • Field Details

  • 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 to
      serverPlatformRootURL - the network address of the server running the OMAS REST servers
      auditLog - logging destination
      testCaseName - 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 to
      serverPlatformRootURL - the network address of the server running the OMAS REST servers
      auditLog - logging destination
      testCaseName - 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 to
      serverPlatformRootURL - the network address of the server running the OMAS REST servers
      auditLog - logging destination
      testCaseName - 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 use
      serverName - name of the server to connect to
      serverPlatformRootURL - the network address of the server running the OMAS REST servers
      userId - calling user
      auditLog - logging destination
      testCaseName - 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 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 client
      testCaseName - calling test case
      activityName - calling activity within the test case
      userId - calling user
      assetManagerGUID - unique identifier of asset manager to associate the identifier with
      assetManagerName - unique name of asset manager to associate the identifier with
      glossaryName - qualified name of glossary
      glossaryDisplayName - display name for glossary
      glossaryDescription - description of glossary
      glossaryUsage - expected usage of the glossary
      glossaryLanguage - language used in the glossary
      glossaryExternalIdentifier - external identifier used in third party technology
      glossaryExternalIdentifierName - name of external identifier used in third party technology
      glossaryExternalIdentifierUsage - usage of external identifier used in third party technology
      glossaryExternalIdentifierSource - source of external identifier used in third party technology
      glossaryExternalIdentifierKeyPattern - key pattern for external identifier used in third party technology
      mappingProperties - 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 client
      testCaseName - calling test case
      activityName - calling activity within the test case
      userId - calling user
      glossaryName - qualified name of glossary
      glossaryDisplayName - display name for glossary
      glossaryDescription - description of glossary
      glossaryUsage - expected usage of the glossary
      glossaryLanguage - 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 FVTUnexpectedCondition
      Verify that an element returned is as expected.
      Parameters:
      testCaseName - calling test case
      activityName - which test
      stepName - which step in test
      retrievedElement - element to test
      glossaryTermGUID - guid of element of interest
      typeName - name of type of glossary term
      qualifiedName - expected qualified name
      displayName - expected display name
      description - expected description
      extendedProperties - additional properties for subtype
      status - 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 FVTUnexpectedCondition
      Validate a returned list of glossary term elements.
      Parameters:
      testCaseName - calling test case
      activityName - which test
      stepName - which step in test
      retrievedElements - elements retrieved from the repository
      glossaryTermGUID - unique identifier of the element to focus on
      typeName - name of type of glossary term
      qualifiedName - expected qualified name
      displayName - expected display name
      description - expected description
      extendedProperties - additional properties for subtype
      status - expected status
      Throws:
      FVTUnexpectedCondition - something was wrong.