Package org.eurekastreams.server.action.execution.notification

Examples of org.eurekastreams.server.action.execution.notification.NotificationBatch


                allowing(systemAdminIdsMapper).execute(null);
                will(returnValue(new ArrayList<Long>(ADMIN_IDS)));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, ACTOR_ID, 0L, 3L));

        context.assertIsSatisfied();

        // check recipients
        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.FLAG_ACTIVITY, NON_ACTOR_ADMIN_IDS);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(6, props.size());
        PropertyMapTestHelper
                .assertPlaceholder(props, NotificationPropertyKeys.ACTOR, PersonModelView.class, ACTOR_ID);
        PropertyMapTestHelper.assertValue(props, "stream", activity.getDestinationStream());
        PropertyMapTestHelper.assertAlias(props, "source", "stream");
View Full Code Here


                allowing(systemAdminIdsMapper).execute(null);
                will(returnValue(new ArrayList<Long>(ADMIN_IDS)));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, ACTOR_ID, 0L, 3L));

        context.assertIsSatisfied();

        // check recipients
        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.FLAG_ACTIVITY, NON_ACTOR_ADMIN_IDS);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(6, props.size());
        PropertyMapTestHelper
                .assertPlaceholder(props, NotificationPropertyKeys.ACTOR, PersonModelView.class, ACTOR_ID);
        PropertyMapTestHelper.assertValue(props, "stream", activity.getDestinationStream());
        PropertyMapTestHelper.assertAlias(props, "source", "stream");
View Full Code Here

                oneOf(subscribersUnrestrictedDAO).execute(GROUP_ID);
                will(returnValue(subscribers));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, ACTOR_ID, GROUP_ID,
                ACTIVITY_ID));

        context.assertIsSatisfied();

        // check recipients
        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.POST_TO_FOLLOWED_STREAM, subscribers);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(5, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "actor", PersonModelView.class, ACTOR_ID);
        PropertyMapTestHelper.assertPlaceholder(props, "stream", DomainGroupModelView.class, GROUP_ID);
        PropertyMapTestHelper.assertAlias(props, "source", "stream");
        PropertyMapTestHelper.assertPlaceholder(props, "activity", ActivityDTO.class, ACTIVITY_ID);
View Full Code Here

                oneOf(subscribersAllDAO).execute(GROUP_ID);
                will(returnValue(subscribers));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, COORDINATOR2_ID, GROUP_ID,
                ACTIVITY_ID));

        context.assertIsSatisfied();

        // check recipients
        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.POST_TO_FOLLOWED_STREAM, subscribers);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(5, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "actor", PersonModelView.class, COORDINATOR2_ID);
        PropertyMapTestHelper.assertPlaceholder(props, "stream", DomainGroupModelView.class, GROUP_ID);
        PropertyMapTestHelper.assertAlias(props, "source", "stream");
        PropertyMapTestHelper.assertPlaceholder(props, "activity", ActivityDTO.class, ACTIVITY_ID);
View Full Code Here

                oneOf(subscribersUnrestrictedDAO).execute(GROUP_ID);
                will(returnValue(Collections.EMPTY_LIST));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, ACTOR_ID, GROUP_ID,
                ACTIVITY_ID));

        context.assertIsSatisfied();
        assertNull(results);
    }
View Full Code Here

        });

        NotificationTranslator<TargetEntityNotificationsRequest> sut = new RequestNewGroupTranslator(groupMapper,
                systemAdminIdsMapper);

        NotificationBatch results = sut.translate(new TargetEntityNotificationsRequest(null, actorId, groupId));

        context.assertIsSatisfied();

        // check recipients
        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.REQUEST_NEW_GROUP, admins);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(5, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "actor", PersonModelView.class, actorId);
        PropertyMapTestHelper.assertValue(props, "group", group);
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.HIGH_PRIORITY, true);
        PropertyMapTestHelper.assertAlias(props, NotificationPropertyKeys.SOURCE, "group");
View Full Code Here

                allowing(group).getUniqueId();
                will(returnValue("somegroup"));
            }
        });

        NotificationBatch results = sut.translate(new TargetEntityNotificationsRequest(
                RequestType.REQUEST_NEW_GROUP_APPROVED, 0L, groupId));

        context.assertIsSatisfied();

        // check recipients
        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.REQUEST_NEW_GROUP_APPROVED, 2L, 4L);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(3, props.size());
        PropertyMapTestHelper.assertValue(props, "group", group);
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.HIGH_PRIORITY, true);
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.URL, "#activity/group/somegroup");
    }
View Full Code Here

                allowing(followersDAO).execute(STREAM_OWNER_ID);
                will(returnValue(new ArrayList<Long>(Arrays.asList(ACTOR_ID, STREAM_OWNER_ID, 5L, 6L, 7L))));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, ACTOR_ID, STREAM_OWNER_ID,
                ACTIVITY_ID));

        // check recipients
        assertEquals(2, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.POST_TO_PERSONAL_STREAM, STREAM_OWNER_ID);
        TranslatorTestHelper.assertRecipients(results, NotificationType.POST_TO_FOLLOWED_STREAM, 5L, 6L, 7L);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(5, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "actor", PersonModelView.class, ACTOR_ID);
        PropertyMapTestHelper.assertPlaceholder(props, "stream", PersonModelView.class, STREAM_OWNER_ID);
        PropertyMapTestHelper.assertPlaceholder(props, "activity", ActivityDTO.class, ACTIVITY_ID);
        PropertyMapTestHelper.assertAlias(props, "source", "stream");
View Full Code Here

                allowing(followersDAO).execute(ACTOR_ID);
                will(returnValue(new ArrayList<Long>()));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, ACTOR_ID, ACTOR_ID,
                ACTIVITY_ID));

        assertNull(results);
    }
View Full Code Here

                allowing(idToUniqueIdDAO).execute(GROUP_ID);
                will(returnValue("somegroup"));
            }
        });

        NotificationBatch results = sut.translate(new TargetEntityNotificationsRequest(null, ACTOR_ID, GROUP_ID));

        context.assertIsSatisfied();

        // check recipients
        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.REQUEST_GROUP_ACCESS, COORDINATOR1_ID,
                COORDINATOR3_ID);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(5, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "actor", PersonModelView.class, ACTOR_ID);
        PropertyMapTestHelper.assertPlaceholder(props, "group", DomainGroupModelView.class, GROUP_ID);
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.HIGH_PRIORITY, true);
        PropertyMapTestHelper.assertAlias(props, NotificationPropertyKeys.SOURCE, "group");
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.execution.notification.NotificationBatch

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.