Package org.openmetadata.service.jdbi3
Class TestCaseRepository
- java.lang.Object
-
- org.openmetadata.service.jdbi3.EntityRepository<TestCase>
-
- org.openmetadata.service.jdbi3.TestCaseRepository
-
public class TestCaseRepository extends EntityRepository<TestCase>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTestCaseRepository.TestUpdater-
Nested classes/interfaces inherited from class org.openmetadata.service.jdbi3.EntityRepository
EntityRepository.EntityUpdater, EntityRepository.Operation
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOLLECTION_PATHstatic StringTESTCASE_RESULT_EXTENSION-
Fields inherited from class org.openmetadata.service.jdbi3.EntityRepository
allowedFields, CACHE_WITH_ID, CACHE_WITH_NAME, dao, daoCollection, entityType, putFields, quoteFqn, supportsExtension, supportsFollower, supportsOwner, supportsSoftDelete, supportsTags, supportsVotes
-
-
Constructor Summary
Constructors Constructor Description TestCaseRepository(CollectionDAO dao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RestUtil.PutResponse<?>addTestCaseResult(String updatedBy, javax.ws.rs.core.UriInfo uriInfo, String fqn, TestCaseResult testCaseResult)RestUtil.PutResponse<TestSuite>addTestCasesToLogicalTestSuite(TestSuite testSuite, List<UUID> testCaseIds)TestCaseclearFields(TestCase test, EntityUtil.Fields fields)Set the requested fields in an entity.RestUtil.DeleteResponse<TestCase>deleteTestCaseFromLogicalTestSuite(UUID testSuiteId, UUID testCaseId)RestUtil.PutResponse<?>deleteTestCaseResult(String updatedBy, String fqn, Long timestamp)intgetTestCaseCount(List<UUID> testCaseIds)ResultList<TestCaseResult>getTestCaseResults(String fqn, Long startTs, Long endTs)EntityRepository.EntityUpdatergetUpdater(TestCase original, TestCase updated, EntityRepository.Operation operation)voidisTestSuiteExecutable(String testSuiteFqn)RestUtil.PatchResponse<TestCaseResult>patchTestCaseResults(String fqn, Long timestamp, String user, javax.json.JsonPatch patch)voidprepare(TestCase test)This method is used for validating an entity to be created during POST, PUT, and PATCH operations and prepare the entity with all the required attributes and relationships.TestCasesetFields(TestCase test, EntityUtil.Fields fields)Set the requested fields in an entity.voidsetFullyQualifiedName(TestCase test)Set fullyQualifiedName of an entityvoidstoreEntity(TestCase test, boolean update)An entity is stored in the backend database as JSON document.voidstoreRelationships(TestCase test)This method is called to store all the relationships of an entity.-
Methods inherited from class org.openmetadata.service.jdbi3.EntityRepository
addDerivedTags, addFollower, addRelationship, addRelationship, addRelationship, applyTags, applyTags, bulkAddToRelationship, checkSystemEntityDeletion, cleanup, clearFieldsInternal, create, createInternal, createOrUpdate, createOrUpdateInternal, delete, deleteByName, deleteExtensionAtTimestamp, deleteExtensionBeforeTimestamp, deleteFollower, deleteFrom, deleteInternal, deleteInternalByName, deleteRelationship, deleteTo, ensureSingleRelationship, exportToCsv, find, findBoth, findByName, findByNameOrNull, findFrom, findFromRecords, findTo, findToRecords, get, get, getAllowedFieldsCopy, getAllTags, getByName, getByName, getChildren, getCommonFields, getContainer, getCustomPropertyFQN, getCustomPropertyFQNPrefix, getEntitiesFromSeedData, getEntitiesFromSeedData, getEntitiesFromSeedData, getExtension, getExtensionAtTimestamp, getExtensionAtTimestampWithOperation, getFields, getFields, getFollowers, getFromEntityRef, getHref, getIngestionPipelines, getLatestExtensionFromTimeseries, getOwner, getOwner, getParent, getReference, getReferenceByName, getResultList, getResultList, getResultsFromAndToTimestamps, getResultsFromAndToTimestamps, getReviewers, getTags, getTags, getToEntityRef, getVersion, getVotes, importFromCsv, initializeEntity, initSeedDataFromResources, listAfter, listAfterWithSkipFailure, listAll, listBefore, listVersions, patch, populateOwner, postCreate, postDelete, postUpdate, preDelete, prepareInternal, removeExtension, restoreEntity, restorePatchAttributes, setFieldsInternal, setInheritedFields, store, storeExtension, storeOwner, storeRelationshipsInternal, storeTimeSeries, storeTimeSeriesWithOperation, update, update, updateOwner, updateVote, validateOwner, validateRoles, validateUsers, withHref
-
-
-
-
Field Detail
-
COLLECTION_PATH
public static final String COLLECTION_PATH
- See Also:
- Constant Field Values
-
TESTCASE_RESULT_EXTENSION
public static final String TESTCASE_RESULT_EXTENSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TestCaseRepository
public TestCaseRepository(CollectionDAO dao)
-
-
Method Detail
-
setFields
public TestCase setFields(TestCase test, EntityUtil.Fields fields)
Description copied from class:EntityRepositorySet the requested fields in an entity. This is used for requesting specific fields in the object during GET operations. It is also used during PUT and PATCH operations to set up fields that can be updated.- Specified by:
setFieldsin classEntityRepository<TestCase>
-
clearFields
public TestCase clearFields(TestCase test, EntityUtil.Fields fields)
Description copied from class:EntityRepositorySet the requested fields in an entity. This is used for requesting specific fields in the object during GET operations. It is also used during PUT and PATCH operations to set up fields that can be updated.- Specified by:
clearFieldsin classEntityRepository<TestCase>
-
patchTestCaseResults
public RestUtil.PatchResponse<TestCaseResult> patchTestCaseResults(String fqn, Long timestamp, String user, javax.json.JsonPatch patch)
-
setFullyQualifiedName
public void setFullyQualifiedName(TestCase test)
Description copied from class:EntityRepositorySet fullyQualifiedName of an entity- Overrides:
setFullyQualifiedNamein classEntityRepository<TestCase>
-
prepare
public void prepare(TestCase test)
Description copied from class:EntityRepositoryThis method is used for validating an entity to be created during POST, PUT, and PATCH operations and prepare the entity with all the required attributes and relationships.The implementation of this method must perform the following:
- Prepare the values for attributes that are not required in the request but can be derived on the server side. Example - >FullyQualifiedNames of an entity can be derived from the hierarchy that an entity belongs to .
- Validate all the attributes of an entity.
- Validate all the relationships of an entity. As an example - during table creation, relationships such as Tags, Owner, Databasea table belongs to are validated. During validation additional information that is not required in the create/update request are set up in the corresponding relationship fields.
- Specified by:
preparein classEntityRepository<TestCase>- See Also:
for an example implementation
-
storeEntity
public void storeEntity(TestCase test, boolean update)
Description copied from class:EntityRepositoryAn entity is stored in the backend database as JSON document. The JSON includes some attributes of the entity and does not include attributes such as href. The relationship fields of an entity is never stored in the JSON document. It is always reconstructed based on relationship edges from the backend database.
As an example, when table entity is stored, the attributes such as href and the relationships such as owner, database, and tags are set to null. These attributes are restored back after the JSON document is stored to be sent as response.- Specified by:
storeEntityin classEntityRepository<TestCase>- See Also:
for an example implementation
-
storeRelationships
public void storeRelationships(TestCase test)
Description copied from class:EntityRepositoryThis method is called to store all the relationships of an entity. It is expected that all relationships are already validated and completely setup before this method is called and no validation of relationships is required.- Specified by:
storeRelationshipsin classEntityRepository<TestCase>- See Also:
for an example implementation
-
addTestCaseResult
public RestUtil.PutResponse<?> addTestCaseResult(String updatedBy, javax.ws.rs.core.UriInfo uriInfo, String fqn, TestCaseResult testCaseResult)
-
deleteTestCaseResult
public RestUtil.PutResponse<?> deleteTestCaseResult(String updatedBy, String fqn, Long timestamp)
-
getTestCaseResults
public ResultList<TestCaseResult> getTestCaseResults(String fqn, Long startTs, Long endTs)
-
isTestSuiteExecutable
public void isTestSuiteExecutable(String testSuiteFqn)
-
addTestCasesToLogicalTestSuite
public RestUtil.PutResponse<TestSuite> addTestCasesToLogicalTestSuite(TestSuite testSuite, List<UUID> testCaseIds)
-
deleteTestCaseFromLogicalTestSuite
public RestUtil.DeleteResponse<TestCase> deleteTestCaseFromLogicalTestSuite(UUID testSuiteId, UUID testCaseId)
-
getUpdater
public EntityRepository.EntityUpdater getUpdater(TestCase original, TestCase updated, EntityRepository.Operation operation)
- Overrides:
getUpdaterin classEntityRepository<TestCase>
-
-