Search in sources :

Example 16 with OrcidSolrResults

use of org.orcid.utils.solr.entities.OrcidSolrResults in project ORCID-Source by ORCID.

the class OrcidSearchManagerImplTest method invalidRecordSearchResult.

private OrcidSolrResults invalidRecordSearchResult() {
    OrcidSolrResults orcidSolrResults = new OrcidSolrResults();
    List<OrcidSolrResult> resultsList = new ArrayList<>();
    orcidSolrResults.setResults(resultsList);
    resultsList.add(getOrcidSolrResult("0000", new Float(37.2)));
    orcidSolrResults.setNumFound(2);
    return orcidSolrResults;
}
Also used : OrcidSolrResult(org.orcid.utils.solr.entities.OrcidSolrResult) ArrayList(java.util.ArrayList) OrcidSolrResults(org.orcid.utils.solr.entities.OrcidSolrResults)

Example 17 with OrcidSolrResults

use of org.orcid.utils.solr.entities.OrcidSolrResults 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());
}
Also used : Search(org.orcid.jaxb.model.v3.dev1.search.Search) List(java.util.List) ArrayList(java.util.ArrayList) FundingList(org.orcid.jaxb.model.message.FundingList) OrcidSolrResults(org.orcid.utils.solr.entities.OrcidSolrResults) Test(org.junit.Test) BaseTest(org.orcid.core.BaseTest)

Aggregations

OrcidSolrResults (org.orcid.utils.solr.entities.OrcidSolrResults)17 OrcidSolrResult (org.orcid.utils.solr.entities.OrcidSolrResult)15 ArrayList (java.util.ArrayList)10 OrcidMessage (org.orcid.jaxb.model.message.OrcidMessage)6 OrcidSearchResult (org.orcid.jaxb.model.message.OrcidSearchResult)6 OrcidSearchResults (org.orcid.jaxb.model.message.OrcidSearchResults)6 List (java.util.List)5 Test (org.junit.Test)5 FundingList (org.orcid.jaxb.model.message.FundingList)4 OrcidSolrDocument (org.orcid.utils.solr.entities.OrcidSolrDocument)4 Map (java.util.Map)3 NonTransientDataAccessResourceException (org.springframework.dao.NonTransientDataAccessResourceException)3 BufferedReader (java.io.BufferedReader)2 IOException (java.io.IOException)2 Reader (java.io.Reader)2 Arrays (java.util.Arrays)2 Date (java.util.Date)2 Collectors (java.util.stream.Collectors)2 Resource (javax.annotation.Resource)2 BaseTest (org.orcid.core.BaseTest)2