agave-notifications/notifications-core/src/test/java/org/iplantc/service/notification/uuid/NotificationAttemptUUIDEntityLookupIT.java
/**
     * Create a test entity persisted and available for lookup.
     *
     * @return
     */
Create a test entity persisted and available for lookup.
@return
Create a test entity persisted and available for lookup . @return
@Override
    public NotificationAttempt createEntity() {
        NotificationAttempt notificationAttempt = null;
        try {
            Notification notification = it.createEmailNotification();
            new NotificationDao().persist(notification);
            notificationAttempt = new NotificationAttempt(notification.getUuid(), notification.getCallbackUrl(),
                    notification.getOwner(), notification.getAssociatedUuid(),
                    notification.getEvent(), "This is a test", Instant.now());
            notificationAttempt.setAssociatedUuid(notification.getAssociatedUuid());
            FailedNotificationAttemptQueue.getInstance().push(notificationAttempt);
        } catch (Exception e) {
            Assert.fail("Unable to create notification delivery attempt", e);
        }
        return notificationAttempt;
    }
@ Override public NotificationAttempt createEntity ( ) { NotificationAttempt notificationAttempt = null ; try { Notification notification = it . createEmailNotification ( ) ; new NotificationDao ( ) . persist ( notification ) ; notificationAttempt = new NotificationAttempt ( notification . getUuid ( ) , notification . getCallbackUrl ( ) , notification . getOwner ( ) , notification . getAssociatedUuid ( ) , notification . getEvent ( ) , "This is a test" , Instant . now ( ) ) ; notificationAttempt . setAssociatedUuid ( notification . getAssociatedUuid ( ) ) ; FailedNotificationAttemptQueue . getInstance ( ) . push ( notificationAttempt ) ; } catch ( Exception e ) { Assert . fail ( "Unable to create notification delivery attempt" , e ) ; } return notificationAttempt ; }
Create a test entity persisted and available for lookup.
Create a test entity persisted and available for lookup .