@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()); }
@Test public void testEdit() throws Exception { log.debug("testing edit..."); bean.setId(1L); assertEquals("edit", bean.edit()); assertNotNull(bean.getPerson()); assertFalse(bean.hasErrors()); }
@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()); }
@Override @Before public void onSetUp() { super.onSetUp(); bean = new PersonForm(); bean.setPersonManager(personManager); }
@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()); }