@Test
    void testIllegalStrictAssignmentFromRequest() {
        QueryProfile profile = new QueryProfile("test");
        profile.setType(testtypeStrict);

        QueryProfile newUser = new QueryProfile("newUser");
        newUser.setType(userStrict);

        profile.set("myUserQueryProfile", newUser, registry);

        try {
            new Query(HttpRequest.createTestRequest("?myUserQueryProfile.nondeclared=someValue",
                            com.yahoo.jdisc.http.HttpRequest.Method.GET),
                    profile.compile(null));
            fail("Above statement should throw");
        } catch (IllegalArgumentException e) {
            // As expected.
            assertTrue(Exceptions.toMessageString(e).contains(
                    "Could not set 'myUserQueryProfile.nondeclared' to 'someValue': 'nondeclared' is not declared in query profile type 'userStrict', and the type is strict"));
        }
    }
Tests overriding a subprofile as an id string through the query.
Here no user profile is set before it is assigned in the query
container-search/src/test/java/com/yahoo/search/query/profile/types/test/QueryProfileTypeTestCase.java