Search in sources :

Example 1 with DefaultOperation

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()));
         */
}
Also used : DefaultSubmodel(io.adminshell.aas.v3.model.impl.DefaultSubmodel) Submodel(io.adminshell.aas.v3.model.Submodel) HttpResponse(org.apache.http.HttpResponse) LangString(io.adminshell.aas.v3.model.LangString) Test(org.junit.Test)

Aggregations

LangString (io.adminshell.aas.v3.model.LangString)1 Submodel (io.adminshell.aas.v3.model.Submodel)1 DefaultSubmodel (io.adminshell.aas.v3.model.impl.DefaultSubmodel)1 HttpResponse (org.apache.http.HttpResponse)1 Test (org.junit.Test)1