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

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


            public void onClick(final ClickEvent event)
            {
                buttonsPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().waitActive());

                GroupMembersModel.getInstance().insert(
                        new SetFollowingStatusRequest(item.getAccountId(), groupShortname, EntityType.GROUP, false,
                                Follower.FollowerStatus.FOLLOWING));
            }
        });

        denyButton.addClickHandler(new ClickHandler()
View Full Code Here


     * Test successful authorization.
     */
    @Test
    public void testAuthorizeFollowingSuccess()
    {
        final SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "anotherntaccount",
                EntityType.PERSON, false, Follower.FollowerStatus.FOLLOWING);

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

     * Test authorization when the person trying to add a follower is not the follower.
     */
    @Test(expected = AuthorizationException.class)
    public void testAuthorizeFollowingFailDifferentUser()
    {
        final SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "anotherntaccount",
                EntityType.PERSON, false, Follower.FollowerStatus.FOLLOWING);

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

     * Test authorization when user is trying to follow themselves.
     */
    @Test(expected = AuthorizationException.class)
    public void testAuthorizeFollowingFailUserFollowingSelf()
    {
        final SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "ntaccount",
                EntityType.PERSON, false, Follower.FollowerStatus.FOLLOWING);

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

     * Method to test successful validation.
     */
    @Test
    public void testValidate()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "followingntaccount",
                EntityType.PERSON, false, Follower.FollowerStatus.FOLLOWING);

        // Need to satisfy this expectation since I am using a sub class to test the base.
        context.checking(new Expectations()
        {
View Full Code Here

     * Method to test failed validation because of invalid following status.
     */
    @Test(expected = ValidationException.class)
    public void testValidateFailureInvalidFollowingStatus()
    {
        SetFollowingStatusRequest request = new SetFollowingStatusRequest("ntaccount", "followingntaccount",
                EntityType.PERSON, false, Follower.FollowerStatus.NOTSPECIFIED);

        ServiceActionContext currentContext = new ServiceActionContext(request, principalMock);
        sut.validate(currentContext);
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    @Test
    public void testAuthorizeAddFollowerPrivateGroup()
    {
        final SetFollowingStatusRequest request = new SetFollowingStatusRequest("1", "1", EntityType.GROUP, false,
                Follower.FollowerStatus.FOLLOWING);

        final DomainGroupModelView testGroup = new DomainGroupModelView();
        testGroup.setIsPublic(false);
        testGroup.setEntityId(1L);
View Full Code Here

     * Test authoring adding a follower to a private group where the person adding the follower is not a coordinator.
     */
    @Test(expected = AuthorizationException.class)
    public void testAuthorizeAddFollowerPrivateGroupNotCoordinator()
    {
        final SetFollowingStatusRequest request = new SetFollowingStatusRequest("1", "1", EntityType.GROUP, false,
                Follower.FollowerStatus.FOLLOWING);

        final DomainGroupModelView testGroup = new DomainGroupModelView();
        testGroup.setIsPublic(false);
        testGroup.setEntityId(1L);
View Full Code Here

     * Test authorizing adding a follower to a public group.
     */
    @Test
    public void testAuthorizeAddFollowerPublicGroup()
    {
        final SetFollowingStatusRequest request = new SetFollowingStatusRequest("1", "1", EntityType.GROUP, false,
                Follower.FollowerStatus.FOLLOWING);

        final DomainGroupModelView testGroup = new DomainGroupModelView();
        testGroup.setIsPublic(true);
        testGroup.setEntityId(1L);
View Full Code Here

     * Test authorizing removing a follower from a private group.
     */
    @Test
    public void testAuthorizeRemoveFollowerPrivateGroup()
    {
        final SetFollowingStatusRequest request = new SetFollowingStatusRequest("1", "1", EntityType.GROUP, false,
                Follower.FollowerStatus.NOTFOLLOWING);

        final DomainGroupModelView testGroup = new DomainGroupModelView();
        testGroup.setIsPublic(false);
        testGroup.setEntityId(1L);
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.