@Before
  public void setUp() {
    user = new UsersDTO("userDBTest" + new Date(), "normal" + new Date());
    entityManager.getTransaction().begin();
    user = userResourceFacadeImp.addUser(user);
    entityManager.getTransaction().commit();

    CrisisTypeDTO crisisTypeDTO = crisisTypeResourceFacadeImp.findCrisisTypeByID(1100L);
    CollectionDTO crisisDTO =
        new CollectionDTO(
            "testCrisisName" + new Date(),
            "testCrisisCode" + new Date(),
            false,
            false,
            crisisTypeDTO,
            user,
            user);
    entityManager.getTransaction().begin();
    crisis = crisisResourceFacadeImp.addCrisis(crisisDTO);
    entityManager.getTransaction().commit();
    getDoc();
    entityManager.getTransaction().begin();
    documentDTO = documentResourceFacadeImp.addDocument(documentDTO);
    entityManager.getTransaction().commit();

    taskAnswer =
        new TaskAnswerDTO(documentDTO.getDocumentID(), user.getUserID(), "test_sample_answer");
    taskAnswer.setFromTrustedUser(true);
    Date date = new Date();
    taskAnswer.setTimestamp(date);
  }
Ejemplo n.º 2
0
 public TaskAnswerDTO toDTO() {
   TaskAnswerDTO dto =
       new TaskAnswerDTO(this.getId().getDocumentId(), this.getId().getUserId(), this.getAnswer());
   dto.setFromTrustedUser(this.isFromTrustedUser());
   return dto;
 }