예제 #1
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());
  }
예제 #2
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());
  }