コード例 #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);
 }
コード例 #2
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());
 }
コード例 #3
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);
   }
 }
コード例 #4
0
  /** @generated */
  @Test
  public void createAdminTest() {
    PodamFactory factory = new PodamFactoryImpl();
    AdminDTO dto = factory.manufacturePojo(AdminDTO.class);

    AdminDTO result = AdminLogic.createAdmin(dto);
    Assert.assertNotNull(result);

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

    Assert.assertEquals(dto.getNombre(), entity.getNombre());
    Assert.assertEquals(dto.getApellido(), entity.getApellido());
    Assert.assertEquals(dto.getTipoC(), entity.getTipoC());
    Assert.assertEquals(dto.getNcedula(), entity.getNcedula());
    Assert.assertEquals(dto.getGenero(), entity.getGenero());
    Assert.assertEquals(dto.getFechaN(), entity.getFechan());
    Assert.assertEquals(dto.getImagen(), entity.getImagen());
  }
コード例 #5
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());
  }