@Test
    void testRefOverride() {
        CompiledQueryProfileRegistry registry = new QueryProfileXMLReader().read("src/test/java/com/yahoo/search/query/profile/config/test/refoverride").compile();

        {
            // Original reference
            Query query = new Query(HttpRequest.createTestRequest("?query=test", Method.GET),
                    registry.getComponent("default"));
            assertNull(query.properties().get("profileRef"));
            assertEquals("MyProfile1", query.properties().get("profileRef.name"));
            assertEquals("myProfile1Only", query.properties().get("profileRef.myProfile1Only"));
            assertNull(query.properties().get("profileRef.myProfile2Only"));
        }

        {
            // Overridden reference
            Query query = new Query(HttpRequest.createTestRequest("?query=test&profileRef=ref:MyProfile2", Method.GET), registry.getComponent("default"));
            assertNull(query.properties().get("profileRef"));
            assertEquals("MyProfile2", query.properties().get("profileRef.name"));
            assertEquals("myProfile2Only", query.properties().get("profileRef.myProfile2Only"));
            assertNull(query.properties().get("profileRef.myProfile1Only"));

            // later assignment
            query.properties().set("profileRef.name", "newName");
            assertEquals("newName", query.properties().get("profileRef.name"));
            // ...will not impact others
            query = new Query(HttpRequest.createTestRequest("?query=test&profileRef=ref:MyProfile2", Method.GET),
                    registry.getComponent("default"));
            assertEquals("MyProfile2", query.properties().get("profileRef.name"));
        }

    }
Tests a subset of the configuration in the system test of this
container-search/src/test/java/com/yahoo/search/query/profile/config/test/XmlReadingTestCase.java