@Test public void test_emptyString() { ObjectNode node = (ObjectNode)Json.mapper.createObjectNode().put("keys",""); Optional<JWKSet> result = new JWKSetDeserializer().convert(node); assertFalse("Was expecting an empty result",result.isPresent()); }
@Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); }
JWKSetDeserializer extends StdConverter<ObjectNode, Optional<JWKSet>> { @Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); } }
JWKSetDeserializer extends StdConverter<ObjectNode, Optional<JWKSet>> { @Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); }  }
JWKSetDeserializer extends StdConverter<ObjectNode, Optional<JWKSet>> { @Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); }  @Override Optional<JWKSet> convert(ObjectNode node); Optional<JWKSet> convert(String jwkSetAsString); }
JWKSetDeserializer extends StdConverter<ObjectNode, Optional<JWKSet>> { @Override public Optional<JWKSet> convert(ObjectNode node) { if (node == null) { return null; } if (node.get("keys") == null || node.get("keys").isNull() || node.get("keys").equals(new TextNode("null")) || node.get("keys").equals(new TextNode("")) ) { return Optional.empty(); } return convert(node.toString()); }  @Override Optional<JWKSet> convert(ObjectNode node); Optional<JWKSet> convert(String jwkSetAsString); final static String PARSE_ERROR_MESSAGE; }