Package org.eurekastreams.commons.actions.context

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


    {
        try
        {

            Serializable params = new SendPrebuiltNotificationRequest(true, null, message, url);
            PrincipalActionContext ctx = TestContextCreator.createPrincipalActionContext(params, null);
            sut.validate(ctx);
        }
        catch (ValidationException ex)
        {
            assertEquals(errorKeys.length, ex.getErrors().size());
View Full Code Here


     */
    @Test
    public final void testValidateParamsWithGoodUuidParams()
    {
        final String uuid = "FAKE-UUID-0000-0000-0000";
        final PrincipalActionContext serviceContext = buildServerActionContext("{" + uuid + "}");
        context.checking(new Expectations()
        {
            {
                oneOf(themeMapper).findByUUID(uuid);
                will(returnValue(testTheme));
            }
        });

        sut.validate(serviceContext);

        assertSame(testTheme, serviceContext.getState().get("THEME"));
    }
View Full Code Here

     * Make sure that valid url argument get approved.
     */
    @Test
    public final void testValidateParamsWithGoodUrlParams()
    {
        final PrincipalActionContext serviceContext = buildServerActionContext(testTheme.getUrl());
        context.checking(new Expectations()
        {
            {
                oneOf(themeMapper).findByUrl(testTheme.getUrl());
                will(returnValue(testTheme));
            }
        });

        sut.validate(serviceContext);

        assertSame(testTheme, serviceContext.getState().get("THEME"));
    }
View Full Code Here

                oneOf(dgmv).setRestricted(false);
            }
        });

        PrincipalActionContext pac = TestContextCreator.createPrincipalActionContext(shortname, null, USER_ID);

        sut.execute(pac);
        context.assertIsSatisfied();
    }
View Full Code Here

                oneOf(dgmv).setStickyActivity(activity);
                oneOf(activity).setShareable(true);
            }
        });

        PrincipalActionContext pac = TestContextCreator.createPrincipalActionContext(shortname, null, USER_ID);

        sut.execute(pac);
        context.assertIsSatisfied();
    }
View Full Code Here

                oneOf(activityMapper).execute(activityId);
                will(returnValue(null));
            }
        });

        PrincipalActionContext pac = TestContextCreator.createPrincipalActionContext(shortname, null, USER_ID);

        sut.execute(pac);
        context.assertIsSatisfied();
    }
View Full Code Here

    public void testExecute()
    {
        final long personId = 28328L;
        final TaskHandlerActionContext<PrincipalActionContext> taskContext = context
                .mock(TaskHandlerActionContext.class);
        final PrincipalActionContext principalActionContext = context.mock(PrincipalActionContext.class);
        final Principal principal = context.mock(Principal.class);
        final String url = "http://foo.com";
        final SetSharedResourceLikeRequest actionRequest = new SetSharedResourceLikeRequest(url, true);
        final SharedResource sharedResourceFoundOrInserted = new SharedResource("http://fOO.com");
        findOrInsertSharedResourceMapper.setReturnedResource(sharedResourceFoundOrInserted);
View Full Code Here

    /**
     * Invokes the SUT with a PrincipalActionContext.
     */
    private void invokeWithPlainAndPrincipal()
    {
        final PrincipalActionContext originalInnerContext = context.mock(PrincipalActionContext.class,
                "originalInnerContext");

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

    /**
     * Invokes the SUT with a TaskHandlerActionContext containing a principal.
     */
    private void invokeWithTaskHandlerAndPrincipal()
    {
        final PrincipalActionContext originalInnerContext = context.mock(PrincipalActionContext.class,
                "originalInnerContext");
        TaskHandlerActionContext originalOuterContext = new TaskHandlerActionContextImpl(originalInnerContext,
                userActionRequests);

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

        final DomainMapper<StreamPopularHashTagsRequest, StreamPopularHashTagsReportDTO> popularHashTagsMapper = context
                .mock(DomainMapper.class);

        final StreamPopularHashTagsRequest request = new StreamPopularHashTagsRequest();
        final StreamPopularHashTagsReportDTO response = new StreamPopularHashTagsReportDTO(null, null);
        final PrincipalActionContext actionContext = context.mock(PrincipalActionContext.class);

        GetStreamPopularHashTagsExecution sut = new GetStreamPopularHashTagsExecution(popularHashTagsMapper);

        context.checking(new Expectations()
        {
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.