@Test
public void testUpdatePatientIdByLocalId() throws SpiritAdapterException,
		EhrException_Exception {

	SpiritUserResponse spiritUserResponse = mock(SpiritUserResponse.class);
	when(webService.usrLogin(any(SpiritSimpleLoginRequest.class)))
			.thenReturn(spiritUserResponse);
	when(spiritUserResponse.getStateID()).thenReturn("stateID");
	PatientDto patientDto = mock(PatientDto.class);
	when(patientDto.getBirthDate()).thenReturn("19070707");
	List<EhrPatientClientDto> ehrPatientClientDtos = new LinkedList<EhrPatientClientDto>();
	EhrPatientClientDto ehrPatientClientDto = mock(EhrPatientClientDto.class);
	ehrPatientClientDtos.add(ehrPatientClientDto);
	EhrPatientRsp patientResponse = mock(EhrPatientRsp.class);
	when(webService.queryPatients(any(EhrPatientRq.class))).thenReturn(
			patientResponse);
	when(patientResponse.getResponseData())
			.thenReturn(ehrPatientClientDtos);
	EhrPatientRsp patientResponse2 = mock(EhrPatientRsp.class);
	when(webService.updatePatient(any(EhrPatientRq.class))).thenReturn(
			patientResponse2);
	when(patientResponse2.getResponseData()).thenReturn(
			ehrPatientClientDtos);
	when(patientResponse2.getResponseData().get(0).getFamilyName())
			.thenReturn("albert");
	when(patientResponse2.getResponseData().get(0).getGivenName())
			.thenReturn("smith");
	EhrPatientClientDto ehrDto = mock(EhrPatientClientDto.class);
	when(
			sHelper.convertFromPatientDto(any(PatientDto.class),
					anyBoolean(), any(EhrPatientClientDto.class)))
			.thenReturn(ehrDto);
	sat.updatePatientByLocId(patientDto);
}