Search in sources :

Example 1 with GetSubmodelByIdRequest

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

the class RequestHandlerManagerTest method testGetSubmodelByIdRequest.

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

Aggregations

OutputModifier (de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier)1 GetSubmodelByIdResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetSubmodelByIdResponse)1 GetSubmodelByIdRequest (de.fraunhofer.iosb.ilt.faaast.service.model.request.GetSubmodelByIdRequest)1 Test (org.junit.Test)1