@Test
    void testMandatoryUserProfileSetInRequest() {
        Fixture1 fixture = new Fixture1();

        QueryProfile test = new QueryProfile("test");
        test.setType(fixture.type);

        QueryProfile myUser = new QueryProfile("user");
        myUser.setType(fixture.user);
        myUser.set("myUserInteger", 1, null);

        QueryProfileRegistry registry = new QueryProfileRegistry();
        registry.register(test);
        registry.register(myUser);
        CompiledQueryProfileRegistry cRegistry = registry.compile();

        // Underspecified request 1
        assertError("Incomplete query: Parameter 'myUserQueryProfile' is mandatory in query profile 'test' of type 'testtype' but is not set",
                new Query(HttpRequest.createTestRequest("?myString=aString", Method.GET), cRegistry.getComponent("test")));

        // Underspecified request 1
        assertError("Incomplete query: Parameter 'myUserQueryProfile.myUserString' is mandatory in query profile 'test' of type 'testtype' but is not set",
                new Query(HttpRequest.createTestRequest("?myString=aString&myUserQueryProfile=user", Method.GET), cRegistry.getComponent("test")));

        // Fully specified request
        assertError(null, new Query(HttpRequest.createTestRequest("?myString=aString&myUserQueryProfile=user&myUserQueryProfile.myUserString=userString", Method.GET), cRegistry.getComponent("test")));
    }
Here, no user query profile is referenced in the query profile, but one is chosen in the request
container-search/src/test/java/com/yahoo/search/query/profile/types/test/MandatoryTestCase.java