Search in sources :

Example 1 with GetAllSubmodelsBySemanticIdRequest

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

the class RequestHandlerManagerTest method testGetAllSubmodelsBySemanticIdRequest.

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

Aggregations

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