Search in sources :

Example 31 with HookNotification

use of org.apache.atlas.model.notification.HookNotification in project atlas by apache.

the class AtlasHookTest method testNotifyEntitiesRetriesOnException.

@Test
public void testNotifyEntitiesRetriesOnException() throws NotificationException {
    List<HookNotification> hookNotifications = new ArrayList<HookNotification>() {

        {
            add(new EntityCreateRequest("user"));
        }
    };
    doThrow(new NotificationException(new Exception())).when(notificationInterface).send(NotificationInterface.NotificationType.HOOK, hookNotifications);
    AtlasHook.notifyEntitiesInternal(hookNotifications, 2, notificationInterface, false, failedMessagesLogger);
    verify(notificationInterface, times(2)).send(NotificationInterface.NotificationType.HOOK, hookNotifications);
}
Also used : HookNotification(org.apache.atlas.model.notification.HookNotification) ArrayList(java.util.ArrayList) NotificationException(org.apache.atlas.notification.NotificationException) EntityCreateRequest(org.apache.atlas.v1.model.notification.HookNotificationV1.EntityCreateRequest) NotificationException(org.apache.atlas.notification.NotificationException) Test(org.testng.annotations.Test)

Aggregations

HookNotification (org.apache.atlas.model.notification.HookNotification)31 Test (org.testng.annotations.Test)18 ArrayList (java.util.ArrayList)13 AtlasEntitiesWithExtInfo (org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo)9 Referenceable (org.apache.atlas.v1.model.instance.Referenceable)9 AtlasObjectId (org.apache.atlas.model.instance.AtlasObjectId)8 EntityCreateRequest (org.apache.atlas.v1.model.notification.HookNotificationV1.EntityCreateRequest)8 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)6 EntityNotificationTest (org.apache.atlas.notification.entity.EntityNotificationTest)6 EntityUpdateRequest (org.apache.atlas.v1.model.notification.HookNotificationV1.EntityUpdateRequest)6 Map (java.util.Map)5 EntityCreateRequestV2 (org.apache.atlas.model.notification.HookNotification.EntityCreateRequestV2)5 NotificationException (org.apache.atlas.notification.NotificationException)5 EntityUpdateRequestV2 (org.apache.atlas.model.notification.HookNotification.EntityUpdateRequestV2)4 AtlasEntityWithExtInfo (org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo)3 EntityDeleteRequestV2 (org.apache.atlas.model.notification.HookNotification.EntityDeleteRequestV2)3 EntityPartialUpdateRequestV2 (org.apache.atlas.model.notification.HookNotification.EntityPartialUpdateRequestV2)3 MessageVersion (org.apache.atlas.model.notification.MessageVersion)2 Table (org.apache.hadoop.hive.ql.metadata.Table)2 ConsumerRecord (org.apache.kafka.clients.consumer.ConsumerRecord)2