@Test
    void testUnoverridableQueryProfile() {
        QueryProfileRegistry registry = new QueryProfileRegistry();

        QueryProfile test = new QueryProfile("test");
        test.setType(type);
        registry.register(test);

        QueryProfile myUser = new QueryProfile("user");
        myUser.setType(user);
        myUser.set("myUserInteger", 1, registry);
        myUser.set("myUserString", "userValue", registry);
        test.set("myUserQueryProfile", myUser, registry);
        registry.register(myUser);

        QueryProfile otherUser = new QueryProfile("otherUser");
        otherUser.setType(user);
        otherUser.set("myUserInteger", 2, registry);
        registry.register(otherUser);

        CompiledQueryProfileRegistry cRegistry = registry.compile();

        Query query = new Query(HttpRequest.createTestRequest("?myUserQueryprofile=otherUser", Method.GET), cRegistry.getComponent("test"));
        assertEquals(0, query.errors().size());
        assertEquals(1, query.properties().get("myUserQueryProfile.myUserInteger"));
    }
Check that a query profile cannot be overridden
container-search/src/test/java/com/yahoo/search/query/profile/types/test/OverrideTestCase.java