Package org.eurekastreams.commons.actions.context

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


        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);
        final ArrayList<String> hashTags = new ArrayList<String>();
        hashTags.add("#foo");
        hashTags.add("#bar");
        response.setPopularHashTags(hashTags);
View Full Code Here


     * Test with invalid request type.
     */
    @Test(expected = ClassCastException.class)
    public void testInvalidRequestType()
    {
        PrincipalActionContext actionContext = TestContextCreator.createPrincipalActionContext(2L, PERSON_ACCOUNT_ID,
                PERSON_ID);

        sut.execute(actionContext);
    }
View Full Code Here

                oneOf(changePreferenceDAO).execute(with(equalInternally(expected)));
                will(returnValue(Boolean.TRUE));
            }
        });

        PrincipalActionContext actionContext = TestContextCreator.createPrincipalActionContext(
                new ChangeStreamActivitySubscriptionRequest(EntityType.GROUP, STREAM_ENTITY_UNIQUE_ID, true, false),
                PERSON_ACCOUNT_ID, PERSON_ID);

        sut.execute(actionContext);
View Full Code Here

                oneOf(changePreferenceDAO).execute(with(equalInternally(expected)));
                will(returnValue(Boolean.TRUE));
            }
        });

        PrincipalActionContext actionContext = TestContextCreator.createPrincipalActionContext(
                new ChangeStreamActivitySubscriptionRequest(EntityType.GROUP, STREAM_ENTITY_UNIQUE_ID, true, true),
                PERSON_ACCOUNT_ID, PERSON_ID);

        sut.execute(actionContext);
View Full Code Here

                oneOf(changePreferenceDAO).execute(with(equalInternally(expected)));
                will(returnValue(Boolean.TRUE));
            }
        });

        PrincipalActionContext actionContext = TestContextCreator.createPrincipalActionContext(
                new ChangeStreamActivitySubscriptionRequest(EntityType.GROUP, STREAM_ENTITY_UNIQUE_ID, false, false),
                PERSON_ACCOUNT_ID, PERSON_ID);

        sut.execute(actionContext);
View Full Code Here

                allowing(systemAdminIdsMapper).execute(null);
                will(returnValue(Collections.singletonList(PERSON_ID)));
            }
        });

        PrincipalActionContext actionContext = TestContextCreator.createPrincipalActionContext(null, ACCOUNT_ID, 0);

        PersonModelView result = (PersonModelView) sut.execute(actionContext);

        context.assertIsSatisfied();
View Full Code Here

                allowing(systemAdminIdsMapper).execute(null);
                will(returnValue(Collections.singletonList(9L)));
            }
        });

        PrincipalActionContext actionContext = TestContextCreator.createPrincipalActionContext(null, ACCOUNT_ID, 0);

        PersonModelView result = (PersonModelView) sut.execute(actionContext);

        context.assertIsSatisfied();
View Full Code Here

                allowing(systemAdminIdsMapper).execute(null);
                will(returnValue(Collections.EMPTY_LIST));
            }
        });

        PrincipalActionContext actionContext = TestContextCreator.createPrincipalActionContext(null, ACCOUNT_ID, 0);

        PersonModelView result = (PersonModelView) sut.execute(actionContext);

        context.assertIsSatisfied();
View Full Code Here

    {
        // get the action
        Object springBean = beanFactory.getBean(actionName);

        // create context
        PrincipalActionContext actionContext = new ClientPrincipalActionContextImpl(actionParameter, principal,
                clientUniqueId);
        actionContext.setActionId(actionName);

        log.debug("Executing action {} for user {}.", actionName, principal.getAccountId());

        // execute (or not) based on type of bean
        if (springBean instanceof ServiceAction)
View Full Code Here

                oneOf(executionTH).execute(with(new EasyMatcher<TaskHandlerActionContext<PrincipalActionContext>>()
                {
                    @Override
                    protected boolean isMatch(final TaskHandlerActionContext<PrincipalActionContext> inTestObject)
                    {
                        PrincipalActionContext inner = inTestObject.getActionContext();
                        return inTestObject.getUserActionRequests() == userActionRequests
                                && inner.getParams() == params && inner.getPrincipal() == principal
                                && inner.getState() != null;
                    }
                }));
                will(returnValue(result));
            }
        });
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.