@SuppressWarnings("unchecked") @Test void testDeleteEntityTypesQuery() { String entityTypeId0 = "MyEntityTypeId0"; String entityTypeId1 = "MyEntityTypeId1"; Query query = Query.create("id", IN, asList(entityTypeId0, entityTypeId1)); org.molgenis.data.Query<EntityType> dataServiceQuery = mock(org.molgenis.data.Query.class); EntityType entityType0 = mock(EntityType.class); EntityType entityType1 = mock(EntityType.class); when(dataServiceQuery.findAll()).thenReturn(Stream.of(entityType0, entityType1)); Repository<EntityType> entityTypeRepository = mock(Repository.class); when(metadataService.getRepository(ENTITY_TYPE_META_DATA, EntityType.class)) .thenReturn(Optional.of(entityTypeRepository)); when(queryMapper.map(query, entityTypeRepository)).thenReturn(dataServiceQuery); metadataApiService.deleteEntityTypesAsync(query); assertAll(() -> verify(metadataApiJobService).scheduleDelete(asList(entityType0, entityType1))); }
@Override public MetadataDeleteJobExecution deleteEntityTypesAsync(Query query) { return metadataApiJobService.scheduleDelete(getEntityTypes(query)); }
MetadataApiServiceImpl implements MetadataApiService { @Override public MetadataDeleteJobExecution deleteEntityTypesAsync(Query query) { return metadataApiJobService.scheduleDelete(getEntityTypes(query)); } }
MetadataApiServiceImpl implements MetadataApiService { @Override public MetadataDeleteJobExecution deleteEntityTypesAsync(Query query) { return metadataApiJobService.scheduleDelete(getEntityTypes(query)); } MetadataApiServiceImpl(
      MetaDataService metadataService,
      QueryMapper queryMapperV3,
      SortMapper sortMapper,
      MetadataApiJobService metadataApiJobService); }
MetadataApiServiceImpl implements MetadataApiService { @Override public MetadataDeleteJobExecution deleteEntityTypesAsync(Query query) { return metadataApiJobService.scheduleDelete(getEntityTypes(query)); } MetadataApiServiceImpl(
      MetaDataService metadataService,
      QueryMapper queryMapperV3,
      SortMapper sortMapper,
      MetadataApiJobService metadataApiJobService); EntityTypes findEntityTypes(
      @Nullable @CheckForNull Query query, Sort sort, int size, int number); @Override EntityType findEntityType(String identifier); @Override Attributes findAttributes(
      String entityTypeId, @Nullable @CheckForNull Query query, Sort sort, int size, int number); @Override Attribute findAttribute(String entityTypeId, String attributeId); @Override MetadataUpsertJobExecution deleteAttributeAsync(String entityTypeId, String attributeId); @Override MetadataUpsertJobExecution deleteAttributesAsync(String entityTypeId, Query query); @Override void createEntityType(EntityType entityType); @Override MetadataUpsertJobExecution updateEntityTypeAsync(EntityType entityType); @Override MetadataDeleteJobExecution deleteEntityTypeAsync(String entityTypeId); @Override MetadataDeleteJobExecution deleteEntityTypesAsync(Query query); }
MetadataApiServiceImpl implements MetadataApiService { @Override public MetadataDeleteJobExecution deleteEntityTypesAsync(Query query) { return metadataApiJobService.scheduleDelete(getEntityTypes(query)); } MetadataApiServiceImpl(
      MetaDataService metadataService,
      QueryMapper queryMapperV3,
      SortMapper sortMapper,
      MetadataApiJobService metadataApiJobService); EntityTypes findEntityTypes(
      @Nullable @CheckForNull Query query, Sort sort, int size, int number); @Override EntityType findEntityType(String identifier); @Override Attributes findAttributes(
      String entityTypeId, @Nullable @CheckForNull Query query, Sort sort, int size, int number); @Override Attribute findAttribute(String entityTypeId, String attributeId); @Override MetadataUpsertJobExecution deleteAttributeAsync(String entityTypeId, String attributeId); @Override MetadataUpsertJobExecution deleteAttributesAsync(String entityTypeId, Query query); @Override void createEntityType(EntityType entityType); @Override MetadataUpsertJobExecution updateEntityTypeAsync(EntityType entityType); @Override MetadataDeleteJobExecution deleteEntityTypeAsync(String entityTypeId); @Override MetadataDeleteJobExecution deleteEntityTypesAsync(Query query);  }