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

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


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

        NotificationBatch results = sut.translate(new GroupMembershipResponseNotificationsRequest(
                RequestType.REQUEST_GROUP_ACCESS_APPROVED, ACTOR_ID, GROUP_ID, REQUESTOR_ID));

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

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(4, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "group", DomainGroupModelView.class, GROUP_ID);
        PropertyMapTestHelper.assertAlias(props, NotificationPropertyKeys.ACTOR, "group");
        PropertyMapTestHelper.assertAlias(props, NotificationPropertyKeys.SOURCE, "group");
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.URL, "#activity/group/somegroup");
View Full Code Here


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

        NotificationBatch results = sut.translate(new GroupMembershipResponseNotificationsRequest(
                RequestType.REQUEST_GROUP_ACCESS_DENIED, ACTOR_ID, GROUP_ID, REQUESTOR_ID));

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

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(3, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "group", DomainGroupModelView.class, GROUP_ID);
        PropertyMapTestHelper.assertAlias(props, NotificationPropertyKeys.ACTOR, "group");
        PropertyMapTestHelper.assertAlias(props, NotificationPropertyKeys.SOURCE, "group");
    }
View Full Code Here

        NotificationTranslator<GroupRemovedNotificationsRequest> sut = new PendingGroupDeniedTranslator();
        GroupRemovedNotificationsRequest request = new GroupRemovedNotificationsRequest(
                RequestType.REQUEST_NEW_GROUP_DENIED, 0, groupName, coordinators);

        NotificationBatch results = sut.translate(request);

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

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(2, props.size());
        PropertyMapTestHelper.assertValue(props, "groupName", groupName);
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.HIGH_PRIORITY, true);
    }
View Full Code Here

                allowing(idToUniqueIdDAO).execute(ACTOR_ID);
                will(returnValue("somebody"));
            }
        });

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

        context.assertIsSatisfied();

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

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(4, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "actor", PersonModelView.class, ACTOR_ID);
        PropertyMapTestHelper.assertPlaceholder(props, "stream", DomainGroupModelView.class, GROUP_FOLLOWED_ID);
        PropertyMapTestHelper.assertAlias(props, "source", "stream");
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.URL, "#activity/person/somebody");
View Full Code Here

                oneOf(coordinatorDAO).execute(GROUP_FOLLOWED_ID);
                will(returnValue(coordinators));
            }
        });

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

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

        final String url = "http://www.eurekastreams.org";

        PrebuiltNotificationsRequest request = new PrebuiltNotificationsRequest(RequestType.EXTERNAL_PRE_BUILT, true,
                clientId, recipientId, message, url);

        NotificationBatch results = sut.translate(request);

        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.PASS_THROUGH, recipientId);

        PropertyMap<Object> props = results.getProperties();
        assertEquals(5, props.size());
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.URL, url);
        PropertyMapTestHelper.assertValue(props, NotificationPropertyKeys.HIGH_PRIORITY, true);
        PropertyMapTestHelper.assertValue(props, "message", message);
        PropertyMapTestHelper.assertPlaceholder(props, NotificationPropertyKeys.SOURCE, OAuthConsumer.class, clientId);
View Full Code Here

                allowing(activity).getOriginalActor();
                will(returnValue(null));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, 1L, 0L, ACTIVITY_ID));

        context.assertIsSatisfied();

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

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(5, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "actor", PersonModelView.class, 1L);
        PropertyMapTestHelper.assertValue(props, "stream", activity.getDestinationStream());
        PropertyMapTestHelper.assertValue(props, "activity", activity);
        PropertyMapTestHelper.assertAlias(props, NotificationPropertyKeys.SOURCE, "stream");
View Full Code Here

                allowing(activity).getOriginalActor();
                will(returnValue(null));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, AUTHOR_ID, 0L, ACTIVITY_ID));

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

                allowing(activity).getOriginalActor();
                will(returnValue(null));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, 1L, 0L, ACTIVITY_ID));

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

                allowing(originalAuthor).getType();
                will(returnValue(EntityType.PERSON));
            }
        });

        NotificationBatch results = sut.translate(new ActivityNotificationsRequest(null, 1L, 0L, ACTIVITY_ID));

        context.assertIsSatisfied();

        // check recipients
        assertEquals(1, results.getRecipients().size());
        TranslatorTestHelper.assertRecipients(results, NotificationType.LIKE_ACTIVITY, AUTHOR_ID, ORIGINAL_AUTHOR_ID);

        // check properties
        PropertyMap<Object> props = results.getProperties();
        assertEquals(5, props.size());
        PropertyMapTestHelper.assertPlaceholder(props, "actor", PersonModelView.class, 1L);
        PropertyMapTestHelper.assertValue(props, "stream", activity.getDestinationStream());
        PropertyMapTestHelper.assertValue(props, "activity", activity);
        PropertyMapTestHelper.assertAlias(props, NotificationPropertyKeys.SOURCE, "stream");
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.