Search in sources :

Example 1 with DeleteAttributesRequest

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

the class MetadataApiControllerTest method testDeleteAttributes.

@Test
void testDeleteAttributes() {
    String entityTypeId = "MyEntityTypeId";
    Query query = Query.create("name", IN, asList("name1", "name2"));
    DeleteAttributesRequest deleteAttributesRequest = new DeleteAttributesRequest();
    deleteAttributesRequest.setQ(query);
    MetadataUpsertJobExecution jobExecution = mockUpsertJobExecution();
    when(metadataApiService.deleteAttributesAsync(entityTypeId, query)).thenReturn(jobExecution);
    metadataApiController.deleteAttributes(entityTypeId, deleteAttributesRequest);
    verify(metadataApiService).deleteAttributesAsync(entityTypeId, query);
}
Also used : MetadataUpsertJobExecution(org.molgenis.api.metadata.v3.job.MetadataUpsertJobExecution) Query(org.molgenis.api.model.Query) DeleteAttributesRequest(org.molgenis.api.metadata.v3.model.DeleteAttributesRequest) Test(org.junit.jupiter.api.Test) AbstractMockitoTest(org.molgenis.test.AbstractMockitoTest)

Aggregations

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