@Test public void testPerformActionGroupStream() throws Exception { context.checking(new Expectations() { { allowing(commentDTOMock).getActivityId(); will(returnValue(ACTIVITY_ID)); allowing(commentDTOMock).getBody(); oneOf(insertActivityCommentMock).execute(with(any(InsertActivityCommentRequest.class))); oneOf(activityDAO).execute(with(ACTIVITY_ID)); will(returnValue(activityDTOMock)); allowing(activityDTOMock).getDestinationStream(); will(returnValue(destinationStreamMock)); allowing(destinationStreamMock).getDestinationEntityId(); will(returnValue(1L)); allowing(destinationStreamMock).getType(); will(returnValue(EntityType.GROUP)); } }); TaskHandlerActionContext<PrincipalActionContext> actionContext = TestContextCreator .createTaskHandlerContextWithPrincipal(commentDTOMock, null, USER_ID); assertNotNull(sut.execute(actionContext)); context.assertIsSatisfied(); assertEquals(1, actionContext.getUserActionRequests().size()); }
@Override public CommentDTO execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { 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; }
PostActivityCommentExecution implements TaskHandlerExecutionStrategy<PrincipalActionContext> { @Override public CommentDTO execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { 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; } }
PostActivityCommentExecution implements TaskHandlerExecutionStrategy<PrincipalActionContext> { @Override public CommentDTO execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { 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; } PostActivityCommentExecution(final InsertActivityComment inInsertCommentDAO,
            final DomainMapper<Long, ActivityDTO> inActivityDAO); }
PostActivityCommentExecution implements TaskHandlerExecutionStrategy<PrincipalActionContext> { @Override public CommentDTO execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { 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; } PostActivityCommentExecution(final InsertActivityComment inInsertCommentDAO,
            final DomainMapper<Long, ActivityDTO> inActivityDAO); @Override CommentDTO execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext); }
PostActivityCommentExecution implements TaskHandlerExecutionStrategy<PrincipalActionContext> { @Override public CommentDTO execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { 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; } PostActivityCommentExecution(final InsertActivityComment inInsertCommentDAO,
            final DomainMapper<Long, ActivityDTO> inActivityDAO); @Override CommentDTO execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext);  }