public void testUpdatePerson() {
// fetching the first person
Set<Person> persons = service.getAllPersons();
Iterator<Person> iterator = persons.iterator();
if (iterator.hasNext()) {
Person person = iterator.next();
// change & save person
person.setEmail("updateMail@test.de");
person.setFirstName("update firstname");
service.updatePerson(person);
// search person via id
Person newPerson = service.findPersonById(person.getId());
// check the email and firstName
assertEquals(newPerson.getEmail(), person.getEmail());
assertEquals(newPerson.getFirstName(), person.getFirstName());
}
}