@Test
    @Timeout(300)
    void test() throws IOException, InterruptedException, ExecutionException {
        String expected = "{"
                + "    \"root\": {"
                + "        \"children\": ["
                + "            {"
                + "                \"children\": ["
                + "                    {"
                + "                        \"fields\": {"
                + "                            \"c\": \"d\""
                + "                        },"
                + "                        \"id\": \"http://localhost/1\","
                + "                        \"relevance\": 0.9,"
                + "                        \"types\": ["
                + "                            \"summary\""
                + "                        ]"
                + "                    }"
                + "                ],"
                + "                \"id\": \"usual\","
                + "                \"relevance\": 1.0"
                + "            },"
                + "            {"
                + "                \"fields\": {"
                + "                    \"e\": \"f\""
                + "                },"
                + "                \"id\": \"type grouphit\","
                + "                \"relevance\": 1.0,"
                + "                \"types\": ["
                + "                    \"grouphit\""
                + "                ]"
                + "            },"
                + "            {"
                + "                \"fields\": {"
                + "                    \"b\": \"foo\""
                + "                },"
                + "                \"id\": \"http://localhost/\","
                + "                \"relevance\": 0.95,"
                + "                \"types\": ["
                + "                    \"summary\""
                + "                ]"
                + "            }"
                + "        ],"
                + "        \"coverage\": {"
                + "            \"coverage\": 100,"
                + "            \"documents\": 500,"
                + "            \"full\": true,"
                + "            \"nodes\": 1,"
                + "            \"results\": 1,"
                + "            \"resultsFull\": 1"
                + "        },"
                + "        \"errors\": ["
                + "            {"
                + "                \"code\": 18,"
                + "                \"message\": \"boom\","
                + "                \"summary\": \"Internal server error.\""
                + "            }"
                + "        ],"
                + "        \"fields\": {"
                + "            \"totalCount\": 0"
                + "        },"
                + "        \"id\": \"toplevel\","
                + "        \"relevance\": 1.0"
                + "    }"
                + "}";
        Query q = new Query("/?query=a&tracelevel=5");
        Execution execution = new Execution(Execution.Context.createContextStub());
        Result r = new Result(q);
        r.setCoverage(new Coverage(500, 500, 1, 1));

        FastHit h = new FastHit("http://localhost/", .95);
        h.setField("$a", "Hello, world.");
        h.setField("b", "foo");
        r.hits().add(h);
        HitGroup g = new HitGroup("usual");
        h = new FastHit("http://localhost/1", .90);
        h.setField("c", "d");
        g.add(h);
        r.hits().add(g);
        HitGroup gg = new HitGroup("type grouphit");
        gg.types().add("grouphit");
        gg.setField("e", "f");
        r.hits().add(gg);
        r.hits().addError(ErrorMessage.createInternalServerError("boom"));
        String summary = render(execution, r);
        assertEqualJsonContent(expected, summary);
    }
Functional testing of {@link JsonRenderer}.

@author Steinar Knutsen
@author bratseth
container-search/src/test/java/com/yahoo/search/rendering/JsonRendererTestCase.java