Project

General

Profile

Revision 95468153

ID9546815301a0810219ea1130a69530ca334a94a2
Parent cfcd10fd
Child 983f0766

Added by Katja Luther almost 2 years ago

ref #8526: fix failing test

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
307 307
        result.setCdmEntity(newTaxon);
308 308

  
309 309
        DeleteResult deleteResult = deleteTaxon(acceptedTaxon.getUuid(), conf, null);
310
        deleteResult.includeResult(deleteSynonym(synonym, confSyn));
310
        if (synonym.isPersited()){
311
            deleteResult.includeResult(deleteSynonym(synonym, confSyn));
312
        }
311 313
        result.includeResult(deleteResult);
312 314
		return result;
313 315

  
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceImplBusinessTest.java
99 99
	public final void testSwapSynonymAndAcceptedTaxon() {
100 100
		t1.addSynonym(s1, homoTypicSynonymType);
101 101

  
102
		service.swapSynonymAndAcceptedTaxon(s1, t1, true);
102
		UpdateResult result = service.swapSynonymAndAcceptedTaxon(s1, t1, true);
103
		Synonym syn = (Synonym)service.load(s1.getUuid());
104
		Assert.assertNull(syn);
105
		TaxonName name = nameService.load(s1n.getUuid());
106
		Assert.assertNotNull(name);
107

  
108
		//The name of the new accepted taxon should be the same as from the former synonym
109
		Assert.assertEquals(((Taxon)result.getCdmEntity()).getName(), name);
110

  
111

  
112

  
113

  
103 114
	}
104 115

  
105 116
	/**

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)