Search in sources :

Example 1 with GetAllSubmodelReferencesRequest

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

the class RequestHandlerManagerTest method testGetAllSubmodelReferencesRequest.

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

Aggregations

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