Search in sources :

Example 1 with PostSubmodelRequest

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

the class RequestHandlerManagerTest method testPostSubmodelRequest.

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

Aggregations

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