Search in sources :

Example 1 with JsonSerializer

use of de.fraunhofer.iosb.ilt.faaast.service.dataformat.json.JsonSerializer in project FAAAST-Service by FraunhoferIOSB.

the class IntegrationTestHttpEndpoint method testGetSubmodelsWithSemanticId.

@Test
public void testGetSubmodelsWithSemanticId() throws SerializationException {
    Submodel expected = environment.getSubmodels().get(1);
    String semnaticId = Base64.getUrlEncoder().encodeToString(new JsonSerializer().write(expected.getSemanticId()).getBytes(StandardCharsets.UTF_8));
    List<Submodel> actual = getListCall(HTTP_SUBMODELS + "?semanticId=" + semnaticId, Submodel.class);
    Assert.assertEquals(List.of(expected), actual);
}
Also used : DefaultSubmodel(io.adminshell.aas.v3.model.impl.DefaultSubmodel) Submodel(io.adminshell.aas.v3.model.Submodel) LangString(io.adminshell.aas.v3.model.LangString) JsonSerializer(de.fraunhofer.iosb.ilt.faaast.service.dataformat.json.JsonSerializer) Test(org.junit.Test)

Example 2 with JsonSerializer

use of de.fraunhofer.iosb.ilt.faaast.service.dataformat.json.JsonSerializer in project FAAAST-Service by FraunhoferIOSB.

the class IntegrationTestHttpEndpoint method testGetSubmodelsEvent.

@Test
public void testGetSubmodelsEvent() throws SerializationException {
    Submodel expected = environment.getSubmodels().get(1);
    String semnaticId = Base64.getUrlEncoder().encodeToString(new JsonSerializer().write(expected.getSemanticId()).getBytes(StandardCharsets.UTF_8));
    setUpEventCheck(expected, ElementReadEventMessage.class, () -> getListCall(HTTP_SUBMODELS + "?semanticId=" + semnaticId));
}
Also used : DefaultSubmodel(io.adminshell.aas.v3.model.impl.DefaultSubmodel) Submodel(io.adminshell.aas.v3.model.Submodel) LangString(io.adminshell.aas.v3.model.LangString) JsonSerializer(de.fraunhofer.iosb.ilt.faaast.service.dataformat.json.JsonSerializer) Test(org.junit.Test)

Aggregations

JsonSerializer (de.fraunhofer.iosb.ilt.faaast.service.dataformat.json.JsonSerializer)2 LangString (io.adminshell.aas.v3.model.LangString)2 Submodel (io.adminshell.aas.v3.model.Submodel)2 DefaultSubmodel (io.adminshell.aas.v3.model.impl.DefaultSubmodel)2 Test (org.junit.Test)2