@Test public void extractJmapRequestShouldNotThrowWhenPropertyMissingInJson() throws Exception { ObjectNode parameters = new ObjectNode(new JsonNodeFactory(false)); JsonNode[] nodes = new JsonNode[] { new ObjectNode(new JsonNodeFactory(false)).textNode("unknwonMethod"), parameters, new ObjectNode(new JsonNodeFactory(false)).textNode("#1")}; testee.extractJmapRequest(InvocationRequest.deserialize(nodes), RequestClass.class); }
@Override public <T extends JmapRequest> T extractJmapRequest(InvocationRequest request, Class<T> requestClass) throws IOException, JsonParseException, JsonMappingException { return objectMapper.readValue(request.getParameters().toString(), requestClass); }
JmapRequestParserImpl implements JmapRequestParser { @Override public <T extends JmapRequest> T extractJmapRequest(InvocationRequest request, Class<T> requestClass) throws IOException, JsonParseException, JsonMappingException { return objectMapper.readValue(request.getParameters().toString(), requestClass); } }
JmapRequestParserImpl implements JmapRequestParser { @Override public <T extends JmapRequest> T extractJmapRequest(InvocationRequest request, Class<T> requestClass) throws IOException, JsonParseException, JsonMappingException { return objectMapper.readValue(request.getParameters().toString(), requestClass); } @Inject  JmapRequestParserImpl(ObjectMapperFactory objectMapperFactory); }
JmapRequestParserImpl implements JmapRequestParser { @Override public <T extends JmapRequest> T extractJmapRequest(InvocationRequest request, Class<T> requestClass) throws IOException, JsonParseException, JsonMappingException { return objectMapper.readValue(request.getParameters().toString(), requestClass); } @Inject  JmapRequestParserImpl(ObjectMapperFactory objectMapperFactory); @Override T extractJmapRequest(InvocationRequest request, Class<T> requestClass); }
JmapRequestParserImpl implements JmapRequestParser { @Override public <T extends JmapRequest> T extractJmapRequest(InvocationRequest request, Class<T> requestClass) throws IOException, JsonParseException, JsonMappingException { return objectMapper.readValue(request.getParameters().toString(), requestClass); } @Inject  JmapRequestParserImpl(ObjectMapperFactory objectMapperFactory); @Override T extractJmapRequest(InvocationRequest request, Class<T> requestClass);  }