Revision b8784167
Added by Katja Luther over 3 years ago
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceImplTest.java | ||
---|---|---|
28 | 28 |
import org.unitils.dbunit.annotation.DataSet; |
29 | 29 |
import org.unitils.spring.annotation.SpringBeanByType; |
30 | 30 |
|
31 |
import eu.etaxonomy.cdm.api.service.config.IdentifiableServiceConfiguratorImpl; |
|
31 | 32 |
import eu.etaxonomy.cdm.api.service.config.IncludedTaxonConfiguration; |
32 | 33 |
import eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator; |
33 | 34 |
import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator; |
... | ... | |
36 | 37 |
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; |
37 | 38 |
import eu.etaxonomy.cdm.api.service.dto.IncludedTaxaDTO; |
38 | 39 |
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException; |
40 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
|
39 | 41 |
import eu.etaxonomy.cdm.model.agent.Person; |
40 | 42 |
import eu.etaxonomy.cdm.model.common.Annotation; |
41 | 43 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
... | ... | |
154 | 156 |
assertEquals(expectedTaxon, actualTaxon); |
155 | 157 |
} |
156 | 158 |
|
159 |
/** |
|
160 |
* Test method for {@link eu.etaxonomy.cdm.api.service.TaxonServiceImpl#getTaxonByUuid(java.util.UUID)}. |
|
161 |
*/ |
|
162 |
@Test |
|
163 |
public final void testGetTaxonByTitle() { |
|
164 |
TaxonName name = TaxonName.NewInstance(NomenclaturalCode.ICNAFP, Rank.SPECIES(), "Abies", null, "alba", null, null, null, null, null); |
|
165 |
Taxon expectedTaxon = Taxon.NewInstance(name, null); |
|
166 |
expectedTaxon.setDoubtful(true); |
|
167 |
TaxonBase taxon = service.save(expectedTaxon); |
|
168 |
IdentifiableServiceConfiguratorImpl<TaxonBase> config = new IdentifiableServiceConfiguratorImpl<TaxonBase>(); |
|
169 |
config.setTitleSearchString("Abies alba*"); |
|
170 |
//doubtful taxa should be found |
|
171 |
Pager<TaxonBase> actualTaxa = service.findByTitle(config); |
|
172 |
assertEquals(expectedTaxon, actualTaxa.getRecords().get(0)); |
|
173 |
|
|
174 |
//and other taxa as well |
|
175 |
expectedTaxon.setDoubtful(false); |
|
176 |
service.saveOrUpdate(expectedTaxon); |
|
177 |
actualTaxa = service.findByTitle(config); |
|
178 |
assertEquals(expectedTaxon, actualTaxa.getRecords().get(0)); |
|
179 |
} |
|
180 |
|
|
181 |
|
|
157 | 182 |
/** |
158 | 183 |
* Test method for {@link eu.etaxonomy.cdm.api.service.TaxonServiceImpl#saveTaxon(eu.etaxonomy.cdm.model.taxon.TaxonBase)}. |
159 | 184 |
*/ |
Also available in: Unified diff
ref #9171: search for pattern and ?+pattern to find doubtful taxa