@Test public void testFilterOneComment() { context.checking(new Expectations() { { oneOf(activityDeleteStrategy).execute(userAccountId, userId, activity); allowing(activity).getFirstComment(); will(returnValue(firstComment)); allowing(activity).getLastComment(); will(returnValue(null)); oneOf(commentDeleteStrategy).execute(with(user.getAccountId()), with(activity), with(any(List.class))); } }); sut.filter(Arrays.asList(activity), user); context.assertIsSatisfied(); }
public void filter(final List<ActivityDTO> activities, final PersonModelView user) { for (ActivityDTO activity : activities) { activityDeletePropertySetter.execute(user.getAccountId(), user.getId(), activity); setCommentDeletable(user.getAccountId(), activity); } }
PopulateActivityDTODeletabilityData implements ActivityFilter { public void filter(final List<ActivityDTO> activities, final PersonModelView user) { for (ActivityDTO activity : activities) { activityDeletePropertySetter.execute(user.getAccountId(), user.getId(), activity); setCommentDeletable(user.getAccountId(), activity); } } }
PopulateActivityDTODeletabilityData implements ActivityFilter { public void filter(final List<ActivityDTO> activities, final PersonModelView user) { for (ActivityDTO activity : activities) { activityDeletePropertySetter.execute(user.getAccountId(), user.getId(), activity); setCommentDeletable(user.getAccountId(), activity); } } PopulateActivityDTODeletabilityData(final CommentDeletePropertyStrategy inCommentDeletePropertySetter,
            final ActivityDeletePropertyStrategy inActivityDeletePropertySetter); }
PopulateActivityDTODeletabilityData implements ActivityFilter { public void filter(final List<ActivityDTO> activities, final PersonModelView user) { for (ActivityDTO activity : activities) { activityDeletePropertySetter.execute(user.getAccountId(), user.getId(), activity); setCommentDeletable(user.getAccountId(), activity); } } PopulateActivityDTODeletabilityData(final CommentDeletePropertyStrategy inCommentDeletePropertySetter,
            final ActivityDeletePropertyStrategy inActivityDeletePropertySetter); void filter(final List<ActivityDTO> activities, final PersonModelView user); }
PopulateActivityDTODeletabilityData implements ActivityFilter { public void filter(final List<ActivityDTO> activities, final PersonModelView user) { for (ActivityDTO activity : activities) { activityDeletePropertySetter.execute(user.getAccountId(), user.getId(), activity); setCommentDeletable(user.getAccountId(), activity); } } PopulateActivityDTODeletabilityData(final CommentDeletePropertyStrategy inCommentDeletePropertySetter,
            final ActivityDeletePropertyStrategy inActivityDeletePropertySetter); void filter(final List<ActivityDTO> activities, final PersonModelView user);  }