@Test
public void submitEditPersonForm() throws PersonNotFoundException {
MockHttpServletRequest mockRequest = new MockHttpServletRequest("/person/edit", "POST");
PersonDTO updated = PersonTestUtil.createDTO(PERSON_ID, FIRST_NAME_UPDATED, LAST_NAME_UPDATED);
Person person = PersonTestUtil.createModelObject(PERSON_ID, FIRST_NAME_UPDATED, LAST_NAME_UPDATED);
when(personServiceMock.update(updated)).thenReturn(person);
initMessageSourceForFeedbackMessage(PersonController.FEEDBACK_MESSAGE_KEY_PERSON_EDITED);
BindingResult bindingResult = bindAndValidate(mockRequest, updated);
RedirectAttributes attributes = new RedirectAttributesModelMap();
String view = controller.submitEditPersonForm(updated, bindingResult, attributes);
verify(personServiceMock, times(1)).update(updated);
verifyNoMoreInteractions(personServiceMock);
String expectedView = createExpectedRedirectViewPath(PersonController.REQUEST_MAPPING_LIST);
assertEquals(expectedView, view);
assertFeedbackMessage(attributes, PersonController.FEEDBACK_MESSAGE_KEY_PERSON_EDITED);
assertEquals(updated.getFirstName(), person.getFirstName());
assertEquals(updated.getLastName(), person.getLastName());
}