Search in sources :

Example 1 with DeleteSubmodelByIdRequest

use of de.fraunhofer.iosb.ilt.faaast.service.model.request.DeleteSubmodelByIdRequest in project FAAAST-Service by FraunhoferIOSB.

the class RequestHandlerManagerTest method testDeleteSubmodelByIdRequest.

@Test
public void testDeleteSubmodelByIdRequest() throws ResourceNotFoundException {
    when(persistence.get(environment.getSubmodels().get(0).getIdentification(), new QueryModifier())).thenReturn(environment.getSubmodels().get(0));
    DeleteSubmodelByIdRequest request = new DeleteSubmodelByIdRequest.Builder().id(environment.getSubmodels().get(0).getIdentification()).build();
    DeleteSubmodelByIdResponse response = manager.execute(request);
    DeleteSubmodelByIdResponse expected = new DeleteSubmodelByIdResponse.Builder().statusCode(StatusCode.Success).build();
    Assert.assertEquals(expected, response);
    verify(persistence).remove(environment.getSubmodels().get(0).getIdentification());
}
Also used : DeleteSubmodelByIdResponse(de.fraunhofer.iosb.ilt.faaast.service.model.api.response.DeleteSubmodelByIdResponse) DeleteSubmodelByIdRequest(de.fraunhofer.iosb.ilt.faaast.service.model.request.DeleteSubmodelByIdRequest) QueryModifier(de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.QueryModifier) Test(org.junit.Test)

Aggregations

QueryModifier (de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.QueryModifier)1 DeleteSubmodelByIdResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.DeleteSubmodelByIdResponse)1 DeleteSubmodelByIdRequest (de.fraunhofer.iosb.ilt.faaast.service.model.request.DeleteSubmodelByIdRequest)1 Test (org.junit.Test)1