use of org.molgenis.api.metadata.v3.model.ReadEntityTypesRequest in project molgenis by molgenis.
the class MetadataApiControllerTest method testGetEntityTypes.
@Test
void testGetEntityTypes() {
int page = 2;
int size = 1;
Sort sort = mock(Sort.class);
Query query = mock(Query.class);
ReadEntityTypesRequest readEntityTypesRequest = new ReadEntityTypesRequest();
readEntityTypesRequest.setPage(page);
readEntityTypesRequest.setSize(size);
readEntityTypesRequest.setSort(sort);
readEntityTypesRequest.setQ(query);
EntityTypes entityTypes = mock(EntityTypes.class);
when(metadataApiService.findEntityTypes(query, sort, size, page)).thenReturn(entityTypes);
EntityTypesResponse entityTypesResponse = mock(EntityTypesResponse.class);
when(entityTypeResponseMapper.toEntityTypesResponse(entityTypes, size, page)).thenReturn(entityTypesResponse);
assertEquals(entityTypesResponse, metadataApiController.getEntityTypes(readEntityTypesRequest));
}
Aggregations