SpiritQueryServiceImpl implements SpiritQueryService { protected PatientDto transferPixPatientDtoToPatientDto( PixPatientDto pixPatientDto) { PatientDto patientDto = new PatientDto(); patientDto.setBirthDate(pixPatientDto.getBirthTimeValue()); patientDto.setCountry("USA"); patientDto.setFirstName(pixPatientDto.getPatientFirstName()); patientDto.setLastName(pixPatientDto.getPatientLastName()); patientDto.setGenderCode(pixPatientDto.getAdministrativeGenderCode()); patientDto.setEmailHome(pixPatientDto.getPatientEmailHome()); patientDto.setSsnNumber(pixPatientDto.getSsn()); patientDto.setLocalPatientId(pixPatientDto.getIdExtension()); return patientDto; } SpiritQueryServiceImpl(SpiritAdapter spiritAdapter); @Override PatientDto addPatient(PixPatientDto pixPatientDto); @Override PatientProfileDto updatePatient(PatientProfileDto patientProfileDto);  }
@SuppressWarnings("deprecation") @Test public void testTransferPixPatientDtoToPatientDto() { PixPatientDto pixPatientDto = mock(PixPatientDto.class); when(pixPatientDto.getBirthTimeValue()).thenReturn("20140509"); when(pixPatientDto.getPatientFirstName()).thenReturn("Albert"); when(pixPatientDto.getPatientLastName()).thenReturn("Smith"); when(pixPatientDto.getAdministrativeGenderCode()).thenReturn("M"); PatientDto patientDto = sqt .transferPixPatientDtoToPatientDto(pixPatientDto); assertEquals("Albert", patientDto.getFirstName()); assertEquals("Smith", patientDto.getLastName()); assertEquals("M", patientDto.getGenderCode()); assertEquals("USA", patientDto.getCountry()); assertEquals("20140509", patientDto.getBirthDate()); }