@Test @Order(order = 7) public void testNotify7() throws Exception { NotifyConfigsEntity notifyConfigs = new NotifyConfigsEntity(); notifyConfigs.setUserId(groupuser1.getUserId()); notifyConfigs.setNotifyMail(INT_FLAG.ON.getValue()); notifyConfigs.setNotifyDesktop(INT_FLAG.ON.getValue()); notifyConfigs.setMyItemComment(INT_FLAG.ON.getValue()); notifyConfigs.setToItemComment(INT_FLAG.ON.getValue()); NotifyConfigsDao.get().save(notifyConfigs); KnowledgesEntity knowledge = knowledge4; // 公開のナレッジにコメント登録 CommentsEntity comment = new CommentsEntity(); comment.setKnowledgeId(knowledge.getKnowledgeId()); CommentsDao.get().save(comment); UsersEntity user = NotifyCommentLogic.get().getInsertUserOnComment(NotifyType.Desktop, comment, knowledge); Assert.assertEquals(loginedUser.getUserId(), user.getUserId()); user = NotifyCommentLogic.get().getInsertUserOnComment(NotifyType.Mail, comment, knowledge); Assert.assertEquals(loginedUser.getUserId(), user.getUserId()); List<UsersEntity> users = NotifyCommentLogic.get().getTargetUsersOnComment(NotifyType.Desktop, comment, knowledge); Assert.assertEquals(1, users.size()); users = NotifyCommentLogic.get().getTargetUsersOnComment(NotifyType.Mail, comment, knowledge); Assert.assertEquals(1, users.size()); }
@Test @Order(order = 4) public void testNotify4() throws Exception { KnowledgesEntity knowledge = knowledge3; // 保護のナレッジにコメント登録 CommentsEntity comment = new CommentsEntity(); comment.setKnowledgeId(knowledge.getKnowledgeId()); CommentsDao.get().save(comment); UsersEntity user = NotifyCommentLogic.get().getInsertUserOnComment(NotifyType.Desktop, comment, knowledge); Assert.assertEquals(loginedUser.getUserId(), user.getUserId()); user = NotifyCommentLogic.get().getInsertUserOnComment(NotifyType.Mail, comment, knowledge); Assert.assertEquals(loginedUser.getUserId(), user.getUserId()); List<UsersEntity> users = NotifyCommentLogic.get().getTargetUsersOnComment(NotifyType.Desktop, comment, knowledge); Assert.assertEquals(1, users.size()); users = NotifyCommentLogic.get().getTargetUsersOnComment(NotifyType.Mail, comment, knowledge); Assert.assertEquals(1, users.size()); }