use of de.fraunhofer.iosb.ilt.faaast.service.model.request.PostSubmodelReferenceRequest in project FAAAST-Service by FraunhoferIOSB.
the class RequestHandlerManagerTest method testPostSubmodelReferenceRequest.
@Test
public void testPostSubmodelReferenceRequest() throws ResourceNotFoundException {
when(persistence.get(environment.getAssetAdministrationShells().get(0).getIdentification(), new QueryModifier())).thenReturn(environment.getAssetAdministrationShells().get(0));
when(persistence.put(environment.getSubmodels().get(0))).thenReturn(environment.getSubmodels().get(0));
PostSubmodelReferenceRequest request = new PostSubmodelReferenceRequest.Builder().id(environment.getAssetAdministrationShells().get(0).getIdentification()).submodelRef(SUBMODEL_ELEMENT_REF).build();
PostSubmodelReferenceResponse response = manager.execute(request);
PostSubmodelReferenceResponse expected = new PostSubmodelReferenceResponse.Builder().statusCode(StatusCode.SuccessCreated).payload(SUBMODEL_ELEMENT_REF).build();
Assert.assertEquals(expected, response);
}
Aggregations