Esempio n. 1
0
 /** @generated */
 @Test
 public void deleteAdminTest() {
   AdminEntity entity = data.get(0);
   AdminLogic.deleteAdmin(entity.getId());
   AdminEntity deleted = em.find(AdminEntity.class, entity.getId());
   Assert.assertNull(deleted);
 }
Esempio n. 2
0
  /** @generated */
  @Test
  public void updateAdminTest() {
    AdminEntity entity = data.get(0);
    PodamFactory factory = new PodamFactoryImpl();
    AdminDTO dto = factory.manufacturePojo(AdminDTO.class);
    dto.setId(entity.getId());

    AdminLogic.updateAdmin(dto);

    AdminEntity resp = em.find(AdminEntity.class, entity.getId());

    Assert.assertEquals(dto.getNombre(), resp.getNombre());
    Assert.assertEquals(dto.getApellido(), resp.getApellido());
    Assert.assertEquals(dto.getTipoC(), resp.getTipoC());
    Assert.assertEquals(dto.getNcedula(), resp.getNcedula());
    Assert.assertEquals(dto.getGenero(), resp.getGenero());
    Assert.assertEquals(dto.getFechaN(), resp.getFechan());
    Assert.assertEquals(dto.getImagen(), resp.getImagen());
  }
Esempio n. 3
0
 /** @generated */
 @Test
 public void getAdminTest() {
   AdminEntity entity = data.get(0);
   AdminDTO dto = AdminLogic.getAdmin(entity.getId());
   Assert.assertNotNull(dto);
   Assert.assertEquals(entity.getNombre(), dto.getNombre());
   Assert.assertEquals(entity.getApellido(), dto.getApellido());
   Assert.assertEquals(entity.getTipoC(), dto.getTipoC());
   Assert.assertEquals(entity.getNcedula(), dto.getNcedula());
   Assert.assertEquals(entity.getGenero(), dto.getGenero());
   Assert.assertEquals(entity.getFechan(), dto.getFechaN());
   Assert.assertEquals(entity.getImagen(), dto.getImagen());
 }
Esempio n. 4
0
 /** @generated */
 @Test
 public void getAdminsTest() {
   List<AdminDTO> list = AdminLogic.getAdmins();
   Assert.assertEquals(data.size(), list.size());
   for (AdminDTO dto : list) {
     boolean found = false;
     for (AdminEntity entity : data) {
       if (dto.getId().equals(entity.getId())) {
         found = true;
       }
     }
     Assert.assertTrue(found);
   }
 }