### Question:
CountriesResource { public JsonNode jsonName(JsonNode nameNode) { Country country = countriesService.getByName(nameNode.get("name").asText()).iterator().next(); ObjectMapper mapper = new ObjectMapper(); JsonNode retNode = mapper.convertValue(country, JsonNode.class); return retNode; }  @GET @Path("/name/{name}") @Produces(MediaType.APPLICATION_JSON) Country name(@PathParam("name") String name); JsonNode jsonName(JsonNode nameNode);  }### Answer:
@Test public void testJavaServiceCallWithJsonNode() throws Exception { String jsonString = "{\"name\": \"greece\"}"; ObjectMapper mapper = new ObjectMapper(); JsonNode inputNode = mapper.readTree(jsonString); JsonNode retNode = resource.jsonName(inputNode); assertNotNull(retNode); assertEquals("Greece", retNode.get("name").textValue()); assertEquals("Europe", retNode.get("region").textValue()); assertEquals("Euro", retNode.get("currencies").get(0).get("name").textValue()); }