Search in sources :

Example 1 with GetAssetInformationRequest

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

the class RequestHandlerManagerTest method testGetAssetInformationRequest.

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

Aggregations

QueryModifier (de.fraunhofer.iosb.ilt.faaast.service.model.api.modifier.QueryModifier)1 GetAssetInformationResponse (de.fraunhofer.iosb.ilt.faaast.service.model.api.response.GetAssetInformationResponse)1 GetAssetInformationRequest (de.fraunhofer.iosb.ilt.faaast.service.model.request.GetAssetInformationRequest)1 Test (org.junit.Test)1