@Test
public void testUpdatePatient() {

	// Arrange
	final long id = 1L;
	final String username = "username";
	final String mrn = "mrn";
	final String eid = "eid";
	Patient patientCurrent = mock(Patient.class);
	Patient patientNew = mock(Patient.class);
	PatientProfileDto patientDto = new PatientProfileDto();
	patientDto.setId(id);
	patientDto.setBirthDate(new Date());
	LookupDto code = new LookupDto();
	code.setCode("M");
	patientDto.setMaritalStatusCode(code);
	when(patientProfileDtoToPatientMapper.map(patientDto)).thenReturn(
			patientNew);
	when(patientRepository.findOne(id)).thenReturn(patientCurrent);
	when(patientCurrent.getUsername()).thenReturn(username);
	when(patientCurrent.getMedicalRecordNumber()).thenReturn(mrn);
	PixManagerBean pixManagerBean = new PixManagerBean();
	pixManagerBean.setSuccess(true);
	when(pixService.updatePatient(any(PixPatientDto.class))).thenReturn(
			pixManagerBean);
	when(pixService.getEid(mrn)).thenReturn(eid);
	// Act
	sut.updatePatient(patientDto);
	// Assert
	verify(patientRepository, times(1)).save(patientNew);
	verify(pixService, times(1)).updatePatient(any(PixPatientDto.class));
}