Search in sources :

Example 1 with GetAllSubmodelElementsRequest

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);
}
Also used : OutputModifier(de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier) Reference(io.adminshell.aas.v3.model.Reference) DefaultReference(io.adminshell.aas.v3.model.impl.DefaultReference) AtomicReference(java.util.concurrent.atomic.AtomicReference) GetAllSubmodelElementsRequest(de.fraunhofer.iosb.ilt.faaast.service.model.request.GetAllSubmodelElementsRequest) GetAllSubmodelElementsResponse(de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllSubmodelElementsResponse) Test(org.junit.Test)

Aggregations

OutputModifier (de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.OutputModifier)1 GetAllSubmodelElementsResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAllSubmodelElementsResponse)1 GetAllSubmodelElementsRequest (de.fraunhofer.iosb.ilt.faaast.service.model.request.GetAllSubmodelElementsRequest)1 Reference (io.adminshell.aas.v3.model.Reference)1 DefaultReference (io.adminshell.aas.v3.model.impl.DefaultReference)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Test (org.junit.Test)1