@Test public void testUpdateCachedEntityWithNoComments() { context.checking(new Expectations() { { oneOf(activity).getFirstComment(); will(returnValue(null)); oneOf(activity).getLastComment(); will(returnValue(null)); } }); boolean returnValue = sut.updateCachedEntity(activity, person); assertFalse(returnValue); context.assertIsSatisfied(); }
@Override protected Boolean updateCachedEntity(final ActivityDTO inActivityDTO, final Person inPerson) { boolean isUpdated = false; CommentDTO firstComment = inActivityDTO.getFirstComment(); CommentDTO lastComment = inActivityDTO.getLastComment(); if (isAuthoredByPerson(firstComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(firstComment, inPerson); } } if (isAuthoredByPerson(lastComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(lastComment, inPerson); } } return isUpdated; }
UpdateAuthorInfoInActivityEmbeddedCachedComments extends UpdateCachedItemsByIds<ActivityDTO, Person> { @Override protected Boolean updateCachedEntity(final ActivityDTO inActivityDTO, final Person inPerson) { boolean isUpdated = false; CommentDTO firstComment = inActivityDTO.getFirstComment(); CommentDTO lastComment = inActivityDTO.getLastComment(); if (isAuthoredByPerson(firstComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(firstComment, inPerson); } } if (isAuthoredByPerson(lastComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(lastComment, inPerson); } } return isUpdated; } }
UpdateAuthorInfoInActivityEmbeddedCachedComments extends UpdateCachedItemsByIds<ActivityDTO, Person> { @Override protected Boolean updateCachedEntity(final ActivityDTO inActivityDTO, final Person inPerson) { boolean isUpdated = false; CommentDTO firstComment = inActivityDTO.getFirstComment(); CommentDTO lastComment = inActivityDTO.getLastComment(); if (isAuthoredByPerson(firstComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(firstComment, inPerson); } } if (isAuthoredByPerson(lastComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(lastComment, inPerson); } } return isUpdated; } UpdateAuthorInfoInActivityEmbeddedCachedComments(final Integer inBatchSize,
            final List<UpdateCommentDTOFromPerson> inCommentUpdaters); }
UpdateAuthorInfoInActivityEmbeddedCachedComments extends UpdateCachedItemsByIds<ActivityDTO, Person> { @Override protected Boolean updateCachedEntity(final ActivityDTO inActivityDTO, final Person inPerson) { boolean isUpdated = false; CommentDTO firstComment = inActivityDTO.getFirstComment(); CommentDTO lastComment = inActivityDTO.getLastComment(); if (isAuthoredByPerson(firstComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(firstComment, inPerson); } } if (isAuthoredByPerson(lastComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(lastComment, inPerson); } } return isUpdated; } UpdateAuthorInfoInActivityEmbeddedCachedComments(final Integer inBatchSize,
            final List<UpdateCommentDTOFromPerson> inCommentUpdaters);  }
UpdateAuthorInfoInActivityEmbeddedCachedComments extends UpdateCachedItemsByIds<ActivityDTO, Person> { @Override protected Boolean updateCachedEntity(final ActivityDTO inActivityDTO, final Person inPerson) { boolean isUpdated = false; CommentDTO firstComment = inActivityDTO.getFirstComment(); CommentDTO lastComment = inActivityDTO.getLastComment(); if (isAuthoredByPerson(firstComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(firstComment, inPerson); } } if (isAuthoredByPerson(lastComment, inPerson)) { for (UpdateCommentDTOFromPerson updater : commentUpdaters) { isUpdated |= updater.execute(lastComment, inPerson); } } return isUpdated; } UpdateAuthorInfoInActivityEmbeddedCachedComments(final Integer inBatchSize,
            final List<UpdateCommentDTOFromPerson> inCommentUpdaters);   }