Search in sources :

Example 1 with GetSubmodelRequest

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

the class RequestHandlerManagerTest method testGetSubmodelRequest.

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

Aggregations

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