Search in sources :

Example 1 with EntityDeleteRequest

use of org.apache.atlas.v1.model.notification.HookNotificationV1.EntityDeleteRequest in project atlas by apache.

the class NotificationHookConsumerIT method testDeleteByQualifiedName.

@Test
public void testDeleteByQualifiedName() throws Exception {
    final Referenceable entity = new Referenceable(DATABASE_TYPE_BUILTIN);
    final String dbName = "db" + randomString();
    entity.set(NAME, dbName);
    entity.set(DESCRIPTION, randomString());
    entity.set(QUALIFIED_NAME, dbName);
    entity.set(CLUSTER_NAME, randomString());
    final String dbId = atlasClientV1.createEntity(entity).get(0);
    sendHookMessage(new EntityDeleteRequest(TEST_USER, DATABASE_TYPE_BUILTIN, QUALIFIED_NAME, dbName));
    waitFor(MAX_WAIT_TIME, new Predicate() {

        @Override
        public boolean evaluate() throws Exception {
            Referenceable getEntity = atlasClientV1.getEntity(dbId);
            return getEntity.getId().getState() == Id.EntityState.DELETED;
        }
    });
}
Also used : EntityDeleteRequest(org.apache.atlas.v1.model.notification.HookNotificationV1.EntityDeleteRequest) Referenceable(org.apache.atlas.v1.model.instance.Referenceable) Test(org.testng.annotations.Test)

Aggregations

Referenceable (org.apache.atlas.v1.model.instance.Referenceable)1 EntityDeleteRequest (org.apache.atlas.v1.model.notification.HookNotificationV1.EntityDeleteRequest)1 Test (org.testng.annotations.Test)1