@Test
public void testUpdatePatient_when_username_does_not_match_and_so_authentication_fails() {

	AuthenticatedUser authenticatedUser = mock(AuthenticatedUser.class);
	when(authenticatedUser.getUsername()).thenReturn("TheUsername");
	when(userContext.getCurrentUser()).thenReturn(authenticatedUser);
	Users user = mock(Users.class);
	when(user.getUsername()).thenReturn("AnotherUsername");
	// Arrange
	PatientProfileDto patientProfileDtoInput = mock(PatientProfileDto.class);
	when(patientProfileDtoInput.getUsername())
			.thenReturn("AnotherUsername");
	// Act
	try {
		sut.updatePatient(patientProfileDtoInput);
	} catch (AuthenticationFailedException e) {
		assertEquals(e.getMessage(),
				"Username does not match current active user.");
	}
	// Assert
	verify(patientRepository, times(0)).save(any(Patient.class));
}