use of org.orcid.jaxb.model.v3.dev1.search.Search in project ORCID-Source by ORCID.
the class OrcidSearchManagerImplTest method testFindOrcidIds.
@Test
public void testFindOrcidIds() {
when(mockSolrDao.findByDocumentCriteria(Matchers.<Map<String, List<String>>>any())).thenReturn(multipleResultsForQuery());
Search search = orcidSearchManager.findOrcidIds(new HashMap<>());
assertNotNull(search);
assertEquals(2, search.getResults().size());
assertEquals(Long.valueOf(2), search.getNumFound());
assertEquals("5678", search.getResults().get(0).getOrcidIdentifier().getPath());
assertEquals("6789", search.getResults().get(1).getOrcidIdentifier().getPath());
}
use of org.orcid.jaxb.model.v3.dev1.search.Search in project ORCID-Source by ORCID.
the class OrcidSearchManagerImplTest method testFindOrcidIdsNoResults.
@Test
public void testFindOrcidIdsNoResults() {
when(mockSolrDao.findByDocumentCriteria(Matchers.<Map<String, List<String>>>any())).thenReturn(new OrcidSolrResults());
Search search = orcidSearchManager.findOrcidIds(new HashMap<>());
assertNotNull(search);
assertEquals(Long.valueOf(0), search.getNumFound());
assertEquals(0, search.getResults().size());
}
use of org.orcid.jaxb.model.v3.dev1.search.Search in project ORCID-Source by ORCID.
the class MemberV3ApiServiceDelegatorImpl method searchByQuery.
@Override
public Response searchByQuery(Map<String, List<String>> solrParams) {
orcidSecurityManager.checkScopes(ScopePathType.READ_PUBLIC);
validateSearchParams(solrParams);
Search search = orcidSearchManager.findOrcidIds(solrParams);
return Response.ok(search).build();
}
Aggregations