Search in sources :

Example 1 with DeleteEntityTypesRequest

use of org.molgenis.api.metadata.v3.model.DeleteEntityTypesRequest in project molgenis by molgenis.

the class MetadataApiControllerTest method testDeleteEntityTypes.

@Test
void testDeleteEntityTypes() {
    Query query = Query.create("id", IN, asList("MyEntityTypeId0", "MyEntityTypeId1"));
    DeleteEntityTypesRequest deleteEntityTypesRequest = new DeleteEntityTypesRequest();
    deleteEntityTypesRequest.setQ(query);
    MetadataDeleteJobExecution jobExecution = mockDeleteJobExecution();
    when(metadataApiService.deleteEntityTypesAsync(query)).thenReturn(jobExecution);
    metadataApiController.deleteEntityTypes(deleteEntityTypesRequest);
    verify(metadataApiService).deleteEntityTypesAsync(query);
}
Also used : Query(org.molgenis.api.model.Query) DeleteEntityTypesRequest(org.molgenis.api.metadata.v3.model.DeleteEntityTypesRequest) MetadataDeleteJobExecution(org.molgenis.api.metadata.v3.job.MetadataDeleteJobExecution) Test(org.junit.jupiter.api.Test) AbstractMockitoTest(org.molgenis.test.AbstractMockitoTest)

Aggregations

Test (org.junit.jupiter.api.Test)1 MetadataDeleteJobExecution (org.molgenis.api.metadata.v3.job.MetadataDeleteJobExecution)1 DeleteEntityTypesRequest (org.molgenis.api.metadata.v3.model.DeleteEntityTypesRequest)1 Query (org.molgenis.api.model.Query)1 AbstractMockitoTest (org.molgenis.test.AbstractMockitoTest)1