Package org.eurekastreams.commons.server

Examples of org.eurekastreams.commons.server.UserActionRequest


        });

        List<UserActionRequest> uaRequests = callExecute();
        assertEquals(1, uaRequests.size());

        UserActionRequest uaRequest = uaRequests.get(0);
        assertEquals("createNotificationsAction", uaRequest.getActionKey());
        TargetEntityNotificationsRequest request = (TargetEntityNotificationsRequest) uaRequest.getParams();
        assertEquals(RequestType.REQUEST_GROUP_ACCESS, request.getType());
        assertEquals(USER_ID, request.getActorId());
        assertEquals(GROUP_ID, request.getTargetEntityId());
    }
View Full Code Here


                .createTaskHandlerAsyncContext(request);
        sut.execute(outerActionContext);

        context.assertIsSatisfied();
        assertEquals(1, outerActionContext.getUserActionRequests().size());
        UserActionRequest outRequest = outerActionContext.getUserActionRequests().get(0);
        assertEquals("deleteCacheKeysAction", outRequest.getActionKey());
        Collection<String> keys = (Collection<String>) outRequest.getParams();
        assertEquals(1, keys.size());
        assertEquals(CacheKeys.PERSON_BY_ID + PERSON_ID, keys.iterator().next());
    }
View Full Code Here

                .createTaskHandlerAsyncContext(request);
        sut.execute(outerActionContext);

        context.assertIsSatisfied();
        assertEquals(1, outerActionContext.getUserActionRequests().size());
        UserActionRequest outRequest = outerActionContext.getUserActionRequests().get(0);
        assertEquals("cachePerson", outRequest.getActionKey());
        assertEquals(PERSON_ID, outRequest.getParams());
    }
View Full Code Here

     */
    private NotificationEmailDTO assertGetSingleResult(final Collection<UserActionRequest> results)
    {
        assertNotNull(results);
        assertEquals(1, results.size());
        UserActionRequest result = results.iterator().next();
        assertNotNull(result);
        assertEquals("sendEmailNotificationAction", result.getActionKey());
        return (NotificationEmailDTO) result.getParams();
    }
View Full Code Here

        // perform sut
        List<UserActionRequest> results = sut.getUpdateCacheRequests(user, personId);

        assertEquals(1, results.size());

        UserActionRequest kickedOffRequest = results.get(0);

        // now take a look at the action that was kicked off
        assertEquals("personActivityAvatarUpdaterAsyncAction", kickedOffRequest.getActionKey());
        Long requestParams = (Long) kickedOffRequest.getParams();
        assertEquals(personId, requestParams);
        assertNull(kickedOffRequest.getUser());

        context.assertIsSatisfied();
    }
View Full Code Here

        List<UserActionRequest> userActionRequests = sut.getUpdateCacheRequests(principal, personId);
        assertEquals(2, userActionRequests.size());

        // action 1
        UserActionRequest actionRequest = userActionRequests.get(0);
        assertEquals("personDisplayNameUpdaterAsyncAction", actionRequest.getActionKey());
        assertNull(actionRequest.getUser());
        assertEquals(personId, actionRequest.getParams());

        // action 3
        actionRequest = userActionRequests.get(1);
        assertEquals("activityRecipientPersonNameUpdaterAsyncAction", actionRequest.getActionKey());
        assertNull(actionRequest.getUser());
        assertEquals(personAccountId, actionRequest.getParams());

        context.assertIsSatisfied();
    }
View Full Code Here

        context.assertIsSatisfied();

        List<UserActionRequest> requests = ctx.getUserActionRequests();
        assertEquals(1, requests.size());
        UserActionRequest request = requests.get(0);
        assertEquals("createNotificationsAction", request.getActionKey());
        PrebuiltNotificationsRequest expected = new PrebuiltNotificationsRequest(RequestType.EXTERNAL_PRE_BUILT, true,
                CLIENT_ID, RECIPIENT_ID, MESSAGE, URL);
        assertTrue(IsEqualInternally.areEqualInternally(expected, request.getParams()));
    }
View Full Code Here

        sut.execute(contextOuter);
        context.assertIsSatisfied();

        assertEquals(1, userActionRequests.size());
        UserActionRequest actualQueueRqst = userActionRequests.get(0);
        assertEquals("createNotificationsAction", actualQueueRqst.getActionKey());
        assertTrue(areEqualInternally(new ActivityNotificationsRequest(RequestType.FLAG_ACTIVITY, USER_ID, 0L,
                ACTIVITY_ID), actualQueueRqst.getParams()));
    }
View Full Code Here

    public void testExecuteWithDisplayNameUpdate()
    {
        final ArrayList<UserActionRequest> requests = new ArrayList<UserActionRequest>();

        final List<UserActionRequest> displayNameRequests = new ArrayList<UserActionRequest>();
        UserActionRequest updateRequest = new UserActionRequest("foo", null, null);
        displayNameRequests.add(updateRequest);

        context.checking(new Expectations()
        {
            {
View Full Code Here

                        with(same(person3)), with(any(Map.class)), with(equal("EMAIL")));
                will(returnValue(false));

                oneOf(notifier).notify(with(equal(NotificationType.LIKE_ACTIVITY)),
                        with(equal(Collections.singletonList(3L))), with(any(Map.class)), with(any(Map.class)));
                will(returnValue(Collections.singletonList(new UserActionRequest("async", null, asyncRequest))));
            }
        });
        expectPrefsMapper(recips, "LIKE", new NotificationFilterPreferenceDTO(1L, "EMAIL", "LIKE"));

        TaskHandlerActionContext<ActionContext> ac = TestContextCreator.createTaskHandlerAsyncContext(request);
View Full Code Here

TOP

Related Classes of org.eurekastreams.commons.server.UserActionRequest

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.