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());
}
Aggregations