use of com.hazelcast.internal.serialization.impl.NavigableJsonInputAdapter in project hazelcast by hazelcast.
the class JsonSchemaHelperTest method testQueryToNonTerminalValueCreatesPattern.
@Test
public void testQueryToNonTerminalValueCreatesPattern() throws IOException {
JsonObject object = Json.object().add("a", Json.object().add("x", 1).add("y", 2)).add("b", false);
NavigableJsonInputAdapter input = toAdapter(new HazelcastJsonValue(object.toString()));
JsonSchemaNode description = JsonSchemaHelper.createSchema(createParserFromInput(input));
JsonPattern pattern = JsonSchemaHelper.createPattern(input, description, splitPath("a"));
assertEquals(new JsonPattern(asList(0)), pattern);
}
use of com.hazelcast.internal.serialization.impl.NavigableJsonInputAdapter in project hazelcast by hazelcast.
the class JsonSchemaHelperTest method testEmptyStringReturnsNullSchema.
@Test
public void testEmptyStringReturnsNullSchema() throws IOException {
NavigableJsonInputAdapter input = toAdapter(new HazelcastJsonValue(""));
JsonSchemaNode description = JsonSchemaHelper.createSchema(createParserFromInput(input));
assertNull(description);
}
Aggregations