use of de.fraunhofer.iosb.ilt.faaast.service.model.request.PostSubmodelElementByPathRequest in project FAAAST-Service by FraunhoferIOSB.
the class RequestHandlerManagerTest method testPostSubmodelElementByPathRequest.
@Test
public void testPostSubmodelElementByPathRequest() throws ResourceNotFoundException {
when(persistence.put(any(), argThat((Reference t) -> true), any())).thenReturn(environment.getSubmodels().get(0).getSubmodelElements().get(0));
PostSubmodelElementByPathRequest request = new PostSubmodelElementByPathRequest.Builder().id(environment.getSubmodels().get(0).getIdentification()).path(ReferenceHelper.toKeys(SUBMODEL_ELEMENT_REF)).build();
PostSubmodelElementByPathResponse response = manager.execute(request);
PostSubmodelElementByPathResponse expected = new PostSubmodelElementByPathResponse.Builder().payload(environment.getSubmodels().get(0).getSubmodelElements().get(0)).statusCode(StatusCode.SuccessCreated).build();
Assert.assertEquals(expected, response);
}
Aggregations