@Test public void noCommentListTest() { final Long activityID = 1L; final List<Long> commentList = new ArrayList<Long>(); CONTEXT.checking(new Expectations() { { oneOf(activity).getId(); will(returnValue(activityID)); oneOf(commentIdsByActivityIdDAOMock).execute(activityID); will(returnValue(commentList)); } }); Assert.assertEquals("0", sut.objectToString(activity)); CONTEXT.assertIsSatisfied(); }
public String objectToString(final Object msgObject) { Activity activity = (Activity) msgObject; Long lastCommentTime = 0L; List<Long> commentList = commentIdsByActivityIdDAO.execute(activity.getId()); if (commentList != null && commentList.size() > 0) { lastCommentTime = commentList.get(commentList.size() - 1); } return Long.toString(lastCommentTime); }
ActivityLastCommentIdClassBridge implements StringBridge { public String objectToString(final Object msgObject) { Activity activity = (Activity) msgObject; Long lastCommentTime = 0L; List<Long> commentList = commentIdsByActivityIdDAO.execute(activity.getId()); if (commentList != null && commentList.size() > 0) { lastCommentTime = commentList.get(commentList.size() - 1); } return Long.toString(lastCommentTime); } }
ActivityLastCommentIdClassBridge implements StringBridge { public String objectToString(final Object msgObject) { Activity activity = (Activity) msgObject; Long lastCommentTime = 0L; List<Long> commentList = commentIdsByActivityIdDAO.execute(activity.getId()); if (commentList != null && commentList.size() > 0) { lastCommentTime = commentList.get(commentList.size() - 1); } return Long.toString(lastCommentTime); }  }
ActivityLastCommentIdClassBridge implements StringBridge { public String objectToString(final Object msgObject) { Activity activity = (Activity) msgObject; Long lastCommentTime = 0L; List<Long> commentList = commentIdsByActivityIdDAO.execute(activity.getId()); if (commentList != null && commentList.size() > 0) { lastCommentTime = commentList.get(commentList.size() - 1); } return Long.toString(lastCommentTime); }  static void setCommentIdsByActivityIdDAO(final DomainMapper<Long, List<Long>> inCommentIdsByActivityIdDAO); String objectToString(final Object msgObject); }
ActivityLastCommentIdClassBridge implements StringBridge { public String objectToString(final Object msgObject) { Activity activity = (Activity) msgObject; Long lastCommentTime = 0L; List<Long> commentList = commentIdsByActivityIdDAO.execute(activity.getId()); if (commentList != null && commentList.size() > 0) { lastCommentTime = commentList.get(commentList.size() - 1); } return Long.toString(lastCommentTime); }  static void setCommentIdsByActivityIdDAO(final DomainMapper<Long, List<Long>> inCommentIdsByActivityIdDAO); String objectToString(final Object msgObject);  }