Class TestSupportedEntityClassificationSearch

java.lang.Object
org.odpi.openmetadata.conformance.beans.OpenMetadataTestCase
org.odpi.openmetadata.conformance.tests.repository.RepositoryConformanceTestCase
org.odpi.openmetadata.conformance.tests.repository.instances.TestSupportedEntityClassificationSearch

public class TestSupportedEntityClassificationSearch extends RepositoryConformanceTestCase
Test that a repository can constrain an entity search by the classifications an entity carries.
findEntities() accepts a SearchClassifications with a MatchCriteria, and it is the only way to ask the repository "which entities carry this classification" - or, under NONE, "which do not". Where it is not relied upon, the code above the repository retrieves a broader set and drops the entities whose classifications do not suit, which costs a larger read and, since the repository has already applied paging by then, returns short pages.
This capability has a history of being wrong quietly. The PostgreSQL query builder carries a note that MatchCriteria was previously ignored here, so every named classification condition was combined the same way and the search returned nothing whatever the caller asked for. A search that returns nothing looks like an empty repository rather than a broken query, which is why it survived - and why it is worth asserting all three criteria rather than only the common one.
  • Constructor Details

    • TestSupportedEntityClassificationSearch

      public TestSupportedEntityClassificationSearch(RepositoryConformanceWorkPad workPad, EntityDef entityDef, List<ClassificationDef> classificationDefs)
      Set up the test case.
      Parameters:
      workPad - place for parameters and results
      entityDef - the entity type to classify
      classificationDefs - the classification types available; the first is the one being tested
  • Method Details