/** Test of getTaskAnswer(documentId, userId) method, of class TaskAnswerResourceFacadeImp. */ @Test public void testinsertTaskAnswerByDocumentIdAndUserId() { taskAnswer.setAnswer("test_sample_answer3"); entityManager.getTransaction().begin(); taskAnswerResourceFacadeImp.insertTaskAnswer(taskAnswer); entityManager.getTransaction().commit(); TaskAnswerDTO taskAnswer = taskAnswerResourceFacadeImp.getTaskAnswer(documentDTO.getDocumentID(), user.getUserID()); assertEquals(documentDTO.getDocumentID(), taskAnswer.getDocumentID()); }
/** Test of getTaskAnswer(documentId) method, of class TaskAnswerResourceFacadeImp. */ @Test public void testGetTaskAnswerByDocumentId() { taskAnswer.setAnswer("test_sample_answer2"); entityManager.getTransaction().begin(); taskAnswerResourceFacadeImp.insertTaskAnswer(taskAnswer); entityManager.getTransaction().commit(); List<TaskAnswerDTO> taskAnswer = taskAnswerResourceFacadeImp.getTaskAnswer(documentDTO.getDocumentID()); assertTrue(taskAnswer.size() >= 1); }