@Test public void deserialize() throws JsonProcessingException, IOException { when(parser.readValueAsTree()).thenReturn(jsonNode); Schema result = new SchemaDeserializer().deserialize(parser, null); assertThat(result, is(schema)); verify(parser).readValueAsTree(); }
@Override public Schema deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException { Parser schemaParser = new Schema.Parser(); schemaParser.setValidateDefaults(true); schemaParser.setValidate(true); return schemaParser.parse(parser.readValueAsTree().toString()); }
SchemaDeserializer extends JsonDeserializer<Schema> { @Override public Schema deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException { Parser schemaParser = new Schema.Parser(); schemaParser.setValidateDefaults(true); schemaParser.setValidate(true); return schemaParser.parse(parser.readValueAsTree().toString()); } }
SchemaDeserializer extends JsonDeserializer<Schema> { @Override public Schema deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException { Parser schemaParser = new Schema.Parser(); schemaParser.setValidateDefaults(true); schemaParser.setValidate(true); return schemaParser.parse(parser.readValueAsTree().toString()); }  }
SchemaDeserializer extends JsonDeserializer<Schema> { @Override public Schema deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException { Parser schemaParser = new Schema.Parser(); schemaParser.setValidateDefaults(true); schemaParser.setValidate(true); return schemaParser.parse(parser.readValueAsTree().toString()); }  @Override Schema deserialize(JsonParser parser, DeserializationContext context); @Override Class<?> handledType(); }
SchemaDeserializer extends JsonDeserializer<Schema> { @Override public Schema deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException { Parser schemaParser = new Schema.Parser(); schemaParser.setValidateDefaults(true); schemaParser.setValidate(true); return schemaParser.parse(parser.readValueAsTree().toString()); }  @Override Schema deserialize(JsonParser parser, DeserializationContext context); @Override Class<?> handledType();  }