Package org.eurekastreams.server.action.request.profile

Examples of org.eurekastreams.server.action.request.profile.SetFollowingStatusRequest


     * Test the validate method when the wrong EntityType is supplied.
     */
    @Test
    public void testFailedValidationWrongEntity()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "followingntaccount",
                EntityType.NOTSET, false, Follower.FollowerStatus.FOLLOWING);

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


     * Test the validate method when the Target is invalid.
     */
    @Test
    public void testFailedValidationTargetInvalid()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "followingntaccount",
                EntityType.PERSON, false, Follower.FollowerStatus.FOLLOWING);

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

     * Test the validate method when the Target is missing.
     */
    @Test
    public void testFailedValidationTargetMissing()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "", EntityType.PERSON, false,
                Follower.FollowerStatus.FOLLOWING);

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

     * Test successful validation.
     */
    @Test
    public void testValidate()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.GROUP, false, Follower.FollowerStatus.FOLLOWING);

        final DomainGroupModelView testTarget = new DomainGroupModelView();
        testTarget.setEntityId(2L);

View Full Code Here

     * Test unsuccessful validation with wrong entity type.
     */
    @Test(expected = ValidationException.class)
    public void testValidateWrongEntityType()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.NOTSET, false, Follower.FollowerStatus.FOLLOWING);

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

     * Test unsuccessful validation with invalid entities.
     */
    @Test(expected = ValidationException.class)
    public void testValidateInvalidEntities()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "groupshortname",
                EntityType.GROUP, false, Follower.FollowerStatus.FOLLOWING);

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

                oneOf(followerIdsMapperMock).execute(2L);
                will(returnValue(targetFollowerIds));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest(followerAccountId, followedAccountId,
                EntityType.PERSON, false, Follower.FollowerStatus.FOLLOWING);
        sut.execute(TestContextCreator.createTaskHandlerContextWithPrincipal(currentRequest, principalMock));

        context.assertIsSatisfied();
    }
View Full Code Here

                oneOf(followerIdsMapperMock).execute(2L);
                will(returnValue(targetFollowerIds));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest(followerAccountId, followedAccountId,
                EntityType.PERSON, false, Follower.FollowerStatus.NOTFOLLOWING);
        sut.execute(TestContextCreator.createTaskHandlerContextWithPrincipal(currentRequest, principalMock));

        context.assertIsSatisfied();
    }
View Full Code Here

                oneOf(getPersonIdByAccountIdMapper).execute(followedAccountId);
                will(throwException(new RuntimeException("NO.")));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest(followerAccountId, followedAccountId,
                EntityType.PERSON, false, Follower.FollowerStatus.FOLLOWING);
        sut.execute(TestContextCreator.createTaskHandlerContextWithPrincipal(currentRequest, principalMock));

        context.assertIsSatisfied();
    }
View Full Code Here

                oneOf(followerIdsMapperMock).execute(2L);
                will(returnValue(targetFollowerIds));
            }
        });

        SetFollowingStatusRequest currentRequest = new SetFollowingStatusRequest(followerAccountId, followedAccountId,
                EntityType.PERSON, false, Follower.FollowerStatus.NOTSPECIFIED);
        sut.execute(TestContextCreator.createTaskHandlerContextWithPrincipal(currentRequest, principalMock));

        context.assertIsSatisfied();
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.action.request.profile.SetFollowingStatusRequest

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.