@SuppressWarnings({"unchecked"})
    @Test
    @Timeout(300)
    void testTracingWithEmptySubtree() throws IOException, InterruptedException, ExecutionException {
        String expected =  "{"
                + "    \"root\": {"
                + "        \"fields\": {"
                + "            \"totalCount\": 0"
                + "        },"
                + "        \"id\": \"toplevel\","
                + "        \"relevance\": 1.0"
                + "    },"
                + "    \"trace\": {"
                + "        \"children\": ["
                + "            {"
                + "                \"message\": \"No query profile is used\""
                + "            },"
                + "            {"
                + "                \"message\": \"Resolved properties:\\ntracelevel: 10 (from request)\\nquery: a (from request)\\n\""
                + "            },"
                + "            {"
                + "                \"children\": ["
                + "                    {"
                + "                        \"timestamp\": 42"
                + "                    }"
                + "                ]"
                + "            }"
                + "        ]"
                + "    }"
                + "}";
        Query q = new Query("/?query=a&tracelevel=10");
        Execution execution = new Execution(Execution.Context.createContextStub());
        Result r = new Result(q);

        execution.search(q);
        new Execution(new Chain<>(), execution.context());
        String summary = render(execution, r);
        var m = Jackson.mapper();

        Map<String, Object> exp = m.readValue(expected, Map.class);
        Map<String, Object> gen = m.readValue(summary, Map.class);
        {
            // nuke timestamp and check it's there
            Map<String, Object> trace = (Map<String, Object>) gen.get("trace");
            List<Object> children1 = (List<Object>) trace.get("children");
            Map<String, Object> subtrace = (Map<String, Object>) children1.get(2);
            List<Object> children2 = (List<Object>) subtrace.get("children");
            Map<String, Object> traceElement = (Map<String, Object>) children2.get(0);
            traceElement.put("timestamp", 42);
        }
        assertEquals(exp, gen);
    }
Functional testing of {@link JsonRenderer}.

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