Search in sources :

Example 1 with GetAllSubmodelsRequest

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

the class RequestHandlerManagerTest method testGetAllSubmodelsRequest.

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

Aggregations

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