Package com.saasovation.common.notification

Examples of com.saasovation.common.notification.NotificationLog


    public NotificationApplicationServiceTest() {
        super();
    }

    public void testCurrentNotificationLog() throws Exception {
        NotificationLog log =
                this.notificationApplicationService.currentNotificationLog();

        assertTrue(NotificationLogFactory.notificationsPerLog() >= log.totalNotifications());
        assertTrue(eventStore.countStoredEvents() >= log.totalNotifications());
        assertFalse(log.hasNextNotificationLog());
        assertTrue(log.hasPreviousNotificationLog());
        assertFalse(log.isArchived());
    }
View Full Code Here


    }

    public void testNotificationLog() throws Exception {
        NotificationLogId id = NotificationLogId.first(NotificationLogFactory.notificationsPerLog());

        NotificationLog log = this.notificationApplicationService.notificationLog(id.encoded());

        assertEquals(NotificationLogFactory.notificationsPerLog(), log.totalNotifications());
        assertTrue(eventStore.countStoredEvents() >= log.totalNotifications());
        assertTrue(log.hasNextNotificationLog());
        assertFalse(log.hasPreviousNotificationLog());
        assertTrue(log.isArchived());
    }
View Full Code Here

    private EventStore eventStore;
    private LevelDBPublishedNotificationTrackerStore publishedNotificationTrackerStore;

    public void testTrackMostRecentPublishedNotification() throws Exception {
        NotificationLogFactory factory = new NotificationLogFactory(eventStore);
        NotificationLog log = factory.createCurrentNotificationLog();

        this.publishedNotificationTrackerStore
            .trackMostRecentPublishedNotification(
                    new PublishedNotificationTracker("saasOvation_test"),
                    log.notifications());

        LevelDBUnitOfWork.current().commit();

        PublishedNotificationTracker tracker =
                this.publishedNotificationTrackerStore
                    .publishedNotificationTracker();

        int notifications = log.notifications().size();

        assertNotNull(tracker);
        assertEquals(log.notifications().get(notifications - 1).notificationId(),
                tracker.mostRecentPublishedNotificationId());
    }
View Full Code Here

    @GET
    @Produces({ OvationsMediaType.ID_OVATION_TYPE })
    public Response getCurrentNotificationLog(
            @Context UriInfo aUriInfo) {

        NotificationLog currentNotificationLog =
            this.notificationApplicationService()
                .currentNotificationLog();

        if (currentNotificationLog == null) {
            throw new WebApplicationException(Response.Status.NOT_FOUND);
View Full Code Here

    @Produces({ OvationsMediaType.ID_OVATION_TYPE })
    public Response getNotificationLog(
            @PathParam("notificationId") String aNotificationId,
            @Context UriInfo aUriInfo) {

        NotificationLog notificationLog =
            this.notificationApplicationService()
                .notificationLog(aNotificationId);

        if (notificationLog == null) {
            throw new WebApplicationException(Response.Status.NOT_FOUND);
View Full Code Here

    }

    public void testBasicNotificationLog() throws Exception {
        this.generateUserEvents();

        NotificationLog currentNotificationLog =
            ApplicationServiceRegistry
                .notificationApplicationService()
                .currentNotificationLog();

        assertNotNull(currentNotificationLog);
View Full Code Here

TOP

Related Classes of com.saasovation.common.notification.NotificationLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.