/** Tests that the date can never be null. */ public void testDate() { assertNotNull(comment.getDate()); comment.setDate(new Date()); assertNotNull(comment.getDate()); comment.setDate(null); assertNotNull(comment.getDate()); }
public Comment addComment(String message, Account currAccount, Task task) { Hibernate.initialize(task.getComments()); Comment comment = new Comment(); comment.setTask(task); comment.setAuthor(currAccount); comment.setDate(new Date()); comment.setMessage(message); wlSrv.addActivityLog(task, message, LogType.COMMENT); return save(comment); }