RetrieveVlerDocumentService implements IRetrieveVlerDocumentService { public Future<VLERDocRetrieveResponse> retrieveVlerDocument(VlerQuery vlerQuery) { logger.debug("retrieveVlerDocument begin"); return new RetrieveVlerDocumentCommand(entityDocRetrieve, vlerQuery, nhinAdapterCfg).queue(); } @Autowired  RetrieveVlerDocumentService(NhinAdapterCfg nhinAdapterCfg); void setEntityDocQuery(EntityDocQueryPortType entityDocQuery); void setEntityDocRetrieve(EntityDocRetrievePortType entityDocRetrieve); Future<VLERDocRetrieveResponse> retrieveVlerDocument(VlerQuery vlerQuery); @Override VLERDocQueryResponse retrieveVlerDocumentList(VlerQuery vlerQuery);  }
@Test public void testRetrieveVlerDocument() { VlerQuery vlerQuery = new VlerQuery(); vlerQuery.setPatientIds(new PatientIds.Builder() .pid(pid) .icn(icn) .uid(uid) .build()); VLERDocRetrieveResponse vlerDocRetrieveResponse = null; try { Future vlerFuture = (Future) this.retrieveVlerDocumentService.retrieveVlerDocument(vlerQuery); vlerDocRetrieveResponse = (VLERDocRetrieveResponse) vlerFuture.get(); } catch (InterruptedException | ExecutionException e) { } VLERDoc vlerDoc = vlerDocRetrieveResponse.getVlerDoc(); assertThat(testDocumentUniqueId, is(vlerDoc.getDocumentUniqueId())); assertThat(testHomeCommunityId, is(vlerDoc.getHomeCommunityId())); assertThat(testName, is(vlerDoc.getName())); assertThat(testRepositoryUniqueId, is(vlerDoc.getRepositoryUniqueId())); assertThat(testSourcePatientId, is(vlerDoc.getSourcePatientId())); assertThat("20140616213908-0400", is(vlerDoc.getCreationTime())); assertThat(testAuthorInstitution, is(vlerDoc.getAuthorList().get(0).getName())); assertThat(testAuthorName, is(vlerDoc.getAuthorList().get(0).getInstitution())); assertThat("text/xml", is(vlerDoc.getMimeType())); }