use of io.adminshell.aas.v3.model.impl.DefaultOperation in project FAAAST-Service by FraunhoferIOSB.
the class IntegrationTestHttpEndpoint method testGetSpecificSubmodelContent.
@Test
public void testGetSpecificSubmodelContent() throws SerializationException, IOException, DeserializationException {
Submodel expected = environment.getSubmodels().get(3);
String identifier = Base64.getUrlEncoder().encodeToString(expected.getIdentification().getIdentifier().getBytes(StandardCharsets.UTF_8));
String url = HTTP_SUBMODELS + "/" + identifier + "/submodel?content=normal";
HttpResponse response = getCall(url);
Submodel actual = retrieveResourceFromResponse(response, Submodel.class);
Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
Assert.assertEquals(expected, actual);
String finalUrl = url;
setUpEventCheck(expected, ElementReadEventMessage.class, () -> getCall(finalUrl));
// TODO: Fix value serialization of DefaultOperation
/*
* url = HTTP_SUBMODELS + "/" + identifier + "/submodel?content=value";
* response = getCall(url);
* Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
* Assert.assertEquals(new JsonSerializer().write(expected, new
* OutputModifier.Builder().content(Content.Value).build()),
* EntityUtils.toString(response.getEntity()));
*/
}
Aggregations