Search in sources :

Example 1 with GetAssetAdministrationShellRequest

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

the class RequestHandlerManagerTest method testGetAssetAdministrationShellRequest.

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

Aggregations

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