Search in sources :

Example 1 with Descriptor

use of io.annot8.common.serialization.TestNested.Descriptor in project annot8 by annot8.

the class Annot8ComponentDescriptorSerializerTest method testNested.

@Test
public void testNested() {
    JsonbConfig config = new JsonbConfig().withSerializers(new Annot8ComponentDescriptorSerializer());
    Jsonb jb = JsonbBuilder.create(config);
    Descriptor desc = new Descriptor();
    String json = jb.toJson(desc);
    assertEquals("{\"io.annot8.common.serialization.TestNested$Descriptor\":{\"name\":\"\",\"settings\":{}}}", json);
}
Also used : JsonbConfig(jakarta.json.bind.JsonbConfig) Jsonb(jakarta.json.bind.Jsonb) Descriptor(io.annot8.common.serialization.TestNested.Descriptor) Test(org.junit.jupiter.api.Test)

Aggregations

Descriptor (io.annot8.common.serialization.TestNested.Descriptor)1 Jsonb (jakarta.json.bind.Jsonb)1 JsonbConfig (jakarta.json.bind.JsonbConfig)1 Test (org.junit.jupiter.api.Test)1