@Test(expected = IllegalArgumentException.class) public void extractJmapRequestShouldThrowWhenNullRequestClass() throws Exception { JsonNode[] nodes = new JsonNode[] { new ObjectNode(new JsonNodeFactory(false)).textNode("unknwonMethod"), new ObjectNode(new JsonNodeFactory(false)).putObject("{\"id\": \"id\"}"), new ObjectNode(new JsonNodeFactory(false)).textNode("#1")}; testee.extractJmapRequest(InvocationRequest.deserialize(nodes), null); }
@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);  }