@Test
    void testSettingValueInStrictTypeNestedUnderUntypedMaps() {
        QueryProfile topMap = new QueryProfile("topMap");

        QueryProfile subMap = new QueryProfile("topSubMap");
        topMap.set("subMap", subMap, registry);

        QueryProfile test = new QueryProfile("test");
        test.setType(testtypeStrict);
        subMap.set("typeProfile", test, registry);

        registry.register(topMap);
        registry.register(subMap);
        registry.register(test);
        CompiledQueryProfileRegistry cRegistry = registry.compile();

        try {
            new Query(
                    HttpRequest.createTestRequest("?subMap.typeProfile.someValue=value",
                            com.yahoo.jdisc.http.HttpRequest.Method.GET),
                    cRegistry.getComponent("topMap"));
            fail("Above statement should throw");
        } catch (IllegalArgumentException e) {
            // As expected.
            assertTrue(Exceptions.toMessageString(e).contains(
                    "Could not set 'subMap.typeProfile.someValue' to 'value': 'someValue' is not declared in query profile type 'testtypeStrict', and the type is strict"));
        }
    }
Tests setting a illegal value in a strict profile nested under untyped maps
container-search/src/test/java/com/yahoo/search/query/profile/types/test/QueryProfileTypeTestCase.java