use of org.molgenis.api.data.v3.model.ReadEntityRequest in project molgenis by molgenis.
the class EntityControllerTest method testGetEntity.
@Test
void testGetEntity() {
String entityTypeId = "MyEntityTypeId";
String entityId = "MyId";
Selection filter = Selection.FULL_SELECTION;
Selection expand = Selection.FULL_SELECTION;
ReadEntityRequest entityRequest = new ReadEntityRequest();
entityRequest.setEntityTypeId(entityTypeId);
entityRequest.setEntityId(entityId);
entityRequest.setFilter(filter);
entityRequest.setExpand(expand);
Entity entity = mock(Entity.class);
when(dataServiceV3.find(entityTypeId, entityId, filter, expand)).thenReturn(entity);
EntityResponse entityResponse = mock(EntityResponse.class);
when(entityMapper.map(entity, filter, expand)).thenReturn(entityResponse);
assertEquals(entityResponse, entityController.getEntity(entityRequest));
}
Aggregations