@Test
    @Timeout(300)
    void testMapInField() throws IOException, InterruptedException, ExecutionException {
        String expected = "{"
                + "    \"root\": {"
                + "        \"children\": ["
                + "            {"
                + "                \"fields\": {"
                + "                    \"structured\": {"
                + "                        \"foo\": \"string foo\","
                + "                        \"bar\": [\"array bar elem 1\", \"array bar elem 2\"],"
                + "                        \"baz\": {\"f1\": \"object baz field 1\", \"f2\": \"object baz field 2\"}"
                + "                    }"
                + "                },"
                + "                \"id\": \"MapInField\","
                + "                \"relevance\": 1.0"
                + "            }"
                + "        ],"
                + "        \"fields\": {"
                + "            \"totalCount\": 1"
                + "        },"
                + "        \"id\": \"toplevel\","
                + "        \"relevance\": 1.0"
                + "    }"
                + "}";
        Result r = newEmptyResult();
        Hit h = new Hit("MapInField");
        Value.ArrayValue atop = new Value.ArrayValue();
        atop.add(new Value.ObjectValue()
                .put("key", new Value.StringValue("foo"))
                .put("value", new Value.StringValue("string foo")))
                .add(new Value.ObjectValue()
                        .put("key", new Value.StringValue("bar"))
                        .put("value", new Value.ArrayValue()
                                .add(new Value.StringValue("array bar elem 1"))
                                .add(new Value.StringValue("array bar elem 2"))))
                .add(new Value.ObjectValue()
                        .put("key", new Value.StringValue("baz"))
                        .put("value", new Value.ObjectValue()
                                .put("f1", new Value.StringValue("object baz field 1"))
                                .put("f2", new Value.StringValue("object baz field 2"))));
        h.setField("structured", atop);
        r.hits().add(h);
        r.setTotalHitCount(1L);
        String summary = render(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