Project

General

Profile

Revision 3ff169c5

ID3ff169c566396d1b65d5e908587fffab6763a53f
Parent 682f52a4
Child a3d196bc

Added by Katja Luther over 1 year ago

fix test for swapAcceptedwithSynonym

View differences:

eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/TaxonNameEditorTest.java
24 24
import eu.etaxonomy.cdm.api.service.IClassificationService;
25 25
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
26 26
import eu.etaxonomy.cdm.api.service.ITaxonService;
27
import eu.etaxonomy.cdm.api.service.UpdateResult;
27 28
import eu.etaxonomy.cdm.model.common.Annotation;
28 29
import eu.etaxonomy.cdm.model.common.Language;
29 30
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
......
195 196
        Synonym synonym = (Synonym)taxonService.load(synonymUuid);
196 197
        TaxonName synonymName = synonym.getName();
197 198

  
198
        taxonService.swapSynonymAndAcceptedTaxon(synonym.getUuid(), taxon.getUuid(), false);
199
        UpdateResult result = taxonService.swapSynonymAndAcceptedTaxon(synonym.getUuid(), taxon.getUuid(), false);
200
        taxon = (Taxon)result.getCdmEntity();
201
        Set<TaxonName> synNames = taxon.getSynonymNames();
202
        Iterator<TaxonName> iterator = synNames.iterator();
203
        if(iterator.hasNext()){
204
            Assert.assertEquals(synonymName, iterator.next());
205
        }else{
206
            Assert.fail();
207
        }
199 208

  
200
        Assert.assertEquals(taxonName, synonym.getName());
201 209
        Assert.assertEquals(synonymName, taxon.getName());
202 210
    }
203 211

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)