Project

General

Profile

Revision 0cf72dcb

ID0cf72dcb29d9acbc9726b85dd9a1a75c1f3cc102
Parent 5c95a5bf
Child 4dc39e99

Added by Andreas Müller over 2 years ago

ref #6072 test missing entity in webservice

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/FindByMarkerDTO.java
13 13

  
14 14
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
15 15
import eu.etaxonomy.cdm.model.common.MarkerType;
16
import eu.etaxonomy.cdm.model.taxon.Taxon;
16 17

  
17 18
/**
18 19
 * DTO for IdentifiableEntities matching a certain marker.
......
40 41
	public class CdmEntity{
41 42
		UUID cdmUuid;
42 43
		String titleCache;
43
		T entitys;
44
		T entity;
44 45
		public CdmEntity(UUID cdmUuid, String titleCache, T entity) {
45 46
			this.cdmUuid = cdmUuid;
46 47
			this.titleCache = titleCache;
47
			this.entitys = entity;
48
			this.entity = (T)new Taxon();
49

  
48 50
		}
49 51
		public UUID getCdmUuid() {return cdmUuid;}
50 52
		public String getTitleCache() {return titleCache;}
51
		public T getEntityX() {return entitys;}
53
		public T getEntity() {return entity;}
52 54

  
53 55
	}
54 56

  
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/IdentifiableServiceBaseTest.java
220 220
        FindByMarkerDTO<Taxon>.Marker marker = dto.getMarker();
221 221
        Assert.assertTrue("Flag must be true", marker.getFlag());
222 222
        Assert.assertEquals("Flag must be true", uuidMarkerTypeCompleted, marker.getTypeUuid());
223
        Assert.assertNotNull("the CDM entity in the dto must not be empty if includeEntity=true", dto.getCdmEntity().getEntityX());
224
        Assert.assertEquals(5000, dto.getCdmEntity().getEntityX().getId());
223
        Assert.assertNotNull("the CDM entity in the dto must not be empty if includeEntity=true", dto.getCdmEntity().getEntity());
224
        Assert.assertEquals(5000, dto.getCdmEntity().getEntity().getId());
225 225

  
226 226
        markerValue = false;
227 227
        taxonPager = taxonService.findByMarker(Taxon.class, markerType, markerValue, rootNode, false, null, null, null);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)