Пример #1
0
 @Test
 public void testRemove() throws Exception {
   Person person = new Person();
   person.setId(2L);
   bean.setPerson(person);
   log.debug("Here is the person.............." + person.getId());
   assertEquals("list", bean.delete());
   assertFalse(bean.hasErrors());
 }
Пример #2
0
  @Test
  public void testAdd() throws Exception {
    Person person = new Person();
    // set required fields
    person.setFirstName("firstName");
    person.setLastName("lastName");
    bean.setPerson(person);

    assertEquals("list", bean.save());
    assertFalse(bean.hasErrors());
  }
Пример #3
0
  @Test
  public void testSave() {
    bean.setId(1L);

    assertEquals("edit", bean.edit());
    assertNotNull(bean.getPerson());
    Person person = bean.getPerson();

    // update fields
    person.setFirstName("firstName");
    person.setLastName("lastName");
    bean.setPerson(person);

    assertEquals("edit", bean.save());
    assertFalse(bean.hasErrors());
  }