Search in sources :

Example 1 with PutSubmodelByIdRequest

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

the class RequestHandlerManagerTest method testPutSubmodelByIdRequest.

@Test
public void testPutSubmodelByIdRequest() throws ResourceNotFoundException {
    when(persistence.put(environment.getSubmodels().get(0))).thenReturn(environment.getSubmodels().get(0));
    PutSubmodelByIdRequest request = new PutSubmodelByIdRequest.Builder().id(environment.getSubmodels().get(0).getIdentification()).submodel(environment.getSubmodels().get(0)).build();
    PutSubmodelByIdResponse response = manager.execute(request);
    PutSubmodelByIdResponse expected = new PutSubmodelByIdResponse.Builder().payload(environment.getSubmodels().get(0)).statusCode(StatusCode.Success).build();
    Assert.assertEquals(expected, response);
}
Also used : PutSubmodelByIdResponse(de.fraunhofer.iosb.ilt.faaast.service.model.api.response.PutSubmodelByIdResponse) PutSubmodelByIdRequest(de.fraunhofer.iosb.ilt.faaast.service.model.request.PutSubmodelByIdRequest) Test(org.junit.Test)

Aggregations

PutSubmodelByIdResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.PutSubmodelByIdResponse)1 PutSubmodelByIdRequest (de.fraunhofer.iosb.ilt.faaast.service.model.request.PutSubmodelByIdRequest)1 Test (org.junit.Test)1