Package org.eurekastreams.server.persistence.mappers.requests

Examples of org.eurekastreams.server.persistence.mappers.requests.InsertActivityCommentRequest


        updateStreamsByActorMapper.execute(persistedActivityDTO);

        // Insert the comment that was posted with a shared post.
        if (inActivityDTO.getFirstComment() != null && inActivityDTO.getVerb().equals(ActivityVerb.SHARE))
        {
            insertCommentDAO.execute(new InsertActivityCommentRequest(actorId, persistedActivityDTO.getId(),
                    inActivityDTO.getFirstComment().getBody()));
        }

        RequestType requestType = null;
View Full Code Here


        assertEquals(3, activityDTO.getCommentCount());
        assertEquals(5L, activityDTO.getFirstComment().getId());
        assertEquals(7, activityDTO.getLastComment().getId());

        // Create the insertRequest and insert the comment via sut.
        InsertActivityCommentRequest insertRequest = new InsertActivityCommentRequest(smithersId, activityId, is1000);
        CommentDTO result = sut.execute(insertRequest);

        // Grab entity id for later use
        long newCommentId = result.getId();

        // flush and clear entityManager before query the DB.
        getEntityManager().flush();
        getEntityManager().clear();

        // Query comment from DB to assert that record was inserted in.
        Comment comment = (Comment) getEntityManager().createQuery("FROM Comment where id = :commentId").setParameter(
                "commentId", newCommentId).getSingleResult();

        // verify correct values were inserted into DB.
        assertNotNull(comment);
        assertEquals(smithersId, comment.getAuthor().getId());
        assertEquals(activityId, comment.getTarget().getId());
        assertEquals(is1000, comment.getBody());

        // Get the activity DTO and assert is was updated correctly by sut.
        activityDTO = activityMapper.execute(activityIds).get(0);
        assertEquals(activityId, activityDTO.getId());
        assertEquals(4, activityDTO.getCommentCount());
        assertEquals(5L, activityDTO.getFirstComment().getId());
        assertEquals(newCommentId, activityDTO.getLastComment().getId());

        // Insert another comment to make sure first/last comment works.
        insertRequest.setContent("another comment");
        result = sut.execute(insertRequest);

        // Get the activity DTO and assert is was updated correctly.
        activityDTO = activityMapper.execute(activityIds).get(0);
        assertEquals(5L, activityDTO.getFirstComment().getId());
View Full Code Here

        assertEquals(3, activityDTO.getCommentCount());
        assertEquals(5L, activityDTO.getFirstComment().getId());
        assertEquals(7, activityDTO.getLastComment().getId());

        // Create the insertRequest and insert the comment via sut.
        InsertActivityCommentRequest insertRequest = new InsertActivityCommentRequest(smithersId, activityId, over1000);

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

    {
        CommentDTO inRequest = (CommentDTO) inActionContext.getActionContext().getParams();

        long personId = inActionContext.getActionContext().getPrincipal().getId();
        long activityId = inRequest.getActivityId();
        CommentDTO results = insertCommentDAO.execute(new InsertActivityCommentRequest(personId, activityId, inRequest
                .getBody()));

        getNotificationUserRequests(personId, activityId, results.getId(), inActionContext.getUserActionRequests());

        return results;
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.persistence.mappers.requests.InsertActivityCommentRequest

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.