use of org.molgenis.api.metadata.v3.model.ReadEntityTypeRequest in project molgenis by molgenis.
the class MetadataApiControllerTest method testGetEntityType.
@Test
void testGetEntityType() {
String entityTypeId = "MyEntityTypeId";
boolean flattenAttrs = true;
boolean i18n = false;
ReadEntityTypeRequest readEntityTypeRequest = new ReadEntityTypeRequest();
readEntityTypeRequest.setFlattenAttributes(flattenAttrs);
readEntityTypeRequest.setI18n(i18n);
EntityType entityType = mock(EntityType.class);
when(metadataApiService.findEntityType(entityTypeId)).thenReturn(entityType);
EntityTypeResponse entityTypeResponse = mock(EntityTypeResponse.class);
when(entityTypeResponseMapper.toEntityTypeResponse(entityType, flattenAttrs, i18n)).thenReturn(entityTypeResponse);
assertEquals(entityTypeResponse, metadataApiController.getEntityType(entityTypeId, readEntityTypeRequest));
}
Aggregations