Search in sources :

Example 1 with TaxonSearchParameters

use of org.openforis.collect.manager.TaxonSearchParameters in project collect by openforis.

the class SpeciesBackupImportJobIntegrationTest method findByCode.

protected TaxonOccurrence findByCode(String code) {
    CollectTaxonomy taxonomy = speciesManager.loadTaxonomyByName(survey, TEST_TAXONOMY_NAME);
    TaxonSearchParameters searchParameters = new TaxonSearchParameters();
    searchParameters.setHighestRank(FAMILY);
    List<TaxonOccurrence> occurrences = speciesManager.findByCode(taxonomy, code, 10, searchParameters);
    assertNotNull(occurrences);
    assertEquals(1, occurrences.size());
    TaxonOccurrence occurrence = occurrences.get(0);
    return occurrence;
}
Also used : TaxonOccurrence(org.openforis.idm.model.TaxonOccurrence) CollectTaxonomy(org.openforis.collect.model.CollectTaxonomy) TaxonSearchParameters(org.openforis.collect.manager.TaxonSearchParameters)

Aggregations

TaxonSearchParameters (org.openforis.collect.manager.TaxonSearchParameters)1 CollectTaxonomy (org.openforis.collect.model.CollectTaxonomy)1 TaxonOccurrence (org.openforis.idm.model.TaxonOccurrence)1