Package org.eurekastreams.commons.actions.context

Examples of org.eurekastreams.commons.actions.context.PrincipalActionContext


        final long gadgetId = tab2GadgetIds.get(3);
        setupSourceAndDestinationTabs(tab2, tab1, gadgetId);

        assertMapperMoveCall(gadgetId, tab2.getTemplate().getId(), 0, 1, tab1.getTemplate().getId(), 0, 0);

        final PrincipalActionContext actionContext = context.mock(PrincipalActionContext.class);
        final Principal principalMock = context.mock(Principal.class);
        final ReorderGadgetRequest request = new ReorderGadgetRequest(tab1.getId(), gadgetId, 0, 0);
        final Map<String, Object> state = new HashMap<String, Object>();

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


        final long gadgetId = tab1GadgetIds.get(5);
        setupSourceAndDestinationTabs(tab1, tab1, gadgetId);

        assertMapperMoveCall(gadgetId, tab1.getTemplate().getId(), 2, 1, tab1.getTemplate().getId(), 1, 1);

        final PrincipalActionContext actionContext = context.mock(PrincipalActionContext.class);
        final Principal principalMock = context.mock(Principal.class);
        final ReorderGadgetRequest request = new ReorderGadgetRequest(tab1.getId(), gadgetId, 1, 1);
        final Map<String, Object> state = new HashMap<String, Object>();

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

    {
        final long gadgetId = tab1GadgetIds.get(5);

        assertMapperMoveCall(gadgetId, tab1.getTemplate().getId(), 2, 1, tab1.getTemplate().getId(), 1, 1);

        final PrincipalActionContext actionContext = context.mock(PrincipalActionContext.class);
        final Principal principalMock = context.mock(Principal.class);
        final ReorderGadgetRequest request = new ReorderGadgetRequest(tab1.getId(), gadgetId, 1, 1);
        final Map<String, Object> state = new HashMap<String, Object>();
        state.put("sourceTemplate", tab1.getTemplate());
        state.put("destinationTemplate", tab1.getTemplate());
View Full Code Here

    @Test(expected = ExecutionException.class)
    public void testExecutionFailure() throws Exception
    {
        final long gadgetId = tab1GadgetIds.get(5);

        final PrincipalActionContext actionContext = context.mock(PrincipalActionContext.class);
        final ReorderGadgetRequest request = new ReorderGadgetRequest(tab1.getId(), gadgetId, 1, 1);
        final Map<String, Object> state = new HashMap<String, Object>();

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

                oneOf(syncMapper).execute(userId);
                will(returnValue(newCount));
            }
        });

        PrincipalActionContext ctx = TestContextCreator.createPrincipalActionContext((Serializable) items, "whomever",
                userId);

        assertTrue(IsEqualInternally.areEqualInternally(newCount, sut.execute(ctx)));

        context.assertIsSatisfied();
View Full Code Here

                oneOf(groupsMapper).execute((List<String>) with(Matchers.hasItems("knowngroup", "avatarlessgroup")));
                will(returnValue(Arrays.asList(group, group2)));
            }
        });

        PrincipalActionContext ctx = TestContextCreator.createPrincipalActionContext(null, "whomever", USER_ID);

        List<InAppNotificationDTO> result = (List<InAppNotificationDTO>) sut.execute(ctx);

        context.assertIsSatisfied();
View Full Code Here

            {
                oneOf(alertMapper).execute(USER_ID);
                will(returnValue(Collections.EMPTY_LIST));
            }
        });
        PrincipalActionContext ctx = TestContextCreator.createPrincipalActionContext(null, "whomever", USER_ID);

        Collection<InAppNotificationDTO> result = (Collection<InAppNotificationDTO>) sut.execute(ctx);

        context.assertIsSatisfied();
        assertTrue(result.isEmpty());
View Full Code Here

                oneOf(followerStatusPopulator).execute(with(any(Long.class)), with(any(List.class)),
                        with(any(FollowerStatus.class)));
            }
        });

        PrincipalActionContext actionContext = TestContextCreator.createPrincipalActionContext(
                new GetStreamsUserIsFollowingRequest(userAccountId, startIndex, endIndex), null, currentUserId);
        List<StreamDTO> results = sut.execute(actionContext).getPagedSet();
        assertEquals(6, results.size());
        assertEquals("a", results.get(0).getDisplayName());
        assertEquals("b", results.get(1).getDisplayName());
View Full Code Here

                oneOf(deleteCacheKeysMapper).execute(with(any(Set.class)));
            }
        });

        // Make the call
        PrincipalActionContext actionContext = buildServerActionContext(themeId);
        actionContext.getState().put("THEME", testTheme);
        String actual = (String) sut.execute(actionContext);

        assertEquals(testTheme.getCssFile(), actual);

        context.assertIsSatisfied();
View Full Code Here

     * @return Context.
     */
    public static PrincipalActionContext createPrincipalActionContext(final Serializable params,
            final Principal principal)
    {
        return new PrincipalActionContext()
        {
            /** Fingerprint. */
            private static final long serialVersionUID = 8084060031869042700L;

            @Override
View Full Code Here

TOP

Related Classes of org.eurekastreams.commons.actions.context.PrincipalActionContext

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.