@Test
    @Timeout(300)
    void testTracing() throws IOException, InterruptedException, ExecutionException {
        // which clearly shows a trace child is created once too often...
        String expected = "{"
                + "    \"root\": {"
                + "        \"fields\": {"
                + "            \"totalCount\": 0"
                + "        },"
                + "        \"id\": \"toplevel\","
                + "        \"relevance\": 1.0"
                + "    },"
                + "    \"trace\": {"
                + "        \"children\": ["
                + "            {"
                + "                \"message\": \"No query profile is used\""
                + "            },"
                + "            {"
                + "                \"children\": ["
                + "                    {"
                + "                        \"message\": \"something\""
                + "                    },"
                + "                    {"
                + "                        \"message\": \"something else\""
                + "                    },"
                + "                    {"
                + "                        \"children\": ["
                + "                            {"
                + "                                \"message\": \"yellow\""
                + "                            }"
                + "                        ]"
                + "                    },"
                + "                    {"
                + "                        \"message\": \"marker\""
                + "                    }"
                + "                ]"
                + "            }"
                + "        ]"
                + "    }"
                + "}";
        Query q = new Query("/?query=a&tracelevel=1");
        Execution execution = new Execution(Execution.Context.createContextStub());
        Result r = new Result(q);

        execution.search(q);
        q.trace("something", 1);
        q.trace("something else", 1);
        Execution e2 = new Execution(new Chain<Searcher>(), execution.context());
        Query subQuery = new Query("/?query=b&tracelevel=1");
        e2.search(subQuery);
        subQuery.trace("yellow", 1);
        q.trace("marker", 1);
        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