use of de.fraunhofer.iosb.ilt.faaast.service.model.request.GetAllSubmodelElementsRequest in project FAAAST-Service by FraunhoferIOSB.
the class RequestHandlerManagerTest method testGetAllSubmodelElementsRequest.
@Test
public void testGetAllSubmodelElementsRequest() throws ResourceNotFoundException {
Reference reference = ReferenceHelper.toReference(environment.getSubmodels().get(0).getIdentification(), Submodel.class);
when(persistence.getSubmodelElements(reference, (Reference) null, new OutputModifier())).thenReturn(environment.getSubmodels().get(0).getSubmodelElements());
GetAllSubmodelElementsRequest request = new GetAllSubmodelElementsRequest.Builder().id(environment.getSubmodels().get(0).getIdentification()).outputModifier(new OutputModifier()).build();
GetAllSubmodelElementsResponse response = manager.execute(request);
GetAllSubmodelElementsResponse expected = new GetAllSubmodelElementsResponse.Builder().payload(environment.getSubmodels().get(0).getSubmodelElements()).statusCode(StatusCode.Success).build();
Assert.assertEquals(expected, response);
}
Aggregations