Search in sources :

Example 1 with PutAssetInformationRequest

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

the class RequestHandlerManagerTest method testPutAssetInformationRequest.

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

Aggregations

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