@Test
public void testDeleteLegalRep() throws Exception {

	when(patientService.isLegalRepForCurrentUser((long) 10)).thenReturn(
			true);
	// successfully deleted
	mockMvc.perform(get("/patients/connectionMain/deleteLegalRep/10"))
			.andExpect(redirectedUrl("/patients/connectionMain.html"));
	// failed to delete
	mockMvc.perform(get("/patients/connectionMain/deleteLegalRep/9"))
			.andExpect(view().name("views/resourceNotFound"));
}