Search in sources :

Example 1 with GetAssetAdministrationShellByIdRequest

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

the class RequestHandlerManagerTest method testGetAssetAdministrationShellByIdRequest.

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

Aggregations

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