@Test
    void testMandatoryInParentType() {
        Fixture2 fixture = new Fixture2();

        QueryProfile defaultProfile = new QueryProfile("default");
        defaultProfile.setType(fixture.rootType);

        QueryProfile mandatoryProfile = new QueryProfile("mandatory");
        mandatoryProfile.setType(fixture.mandatoryType);

        fixture.registry.register(defaultProfile);
        fixture.registry.register(mandatoryProfile);
        CompiledQueryProfileRegistry cRegistry = fixture.registry.compile();

        assertError("Incomplete query: Parameter 'foobar' is mandatory in query profile 'mandatory' of type 'mandatory-type' but is not set",
                new Query(QueryTestCase.httpEncode("?queryProfile=mandatory"), cRegistry.getComponent("mandatory")));
    }
Here, a partially specified query profile is added to a non-mandatory field, making the request underspecified
container-search/src/test/java/com/yahoo/search/query/profile/types/test/MandatoryTestCase.java