@Test
    void testQueryFromProfile2() {
        QueryProfileRegistry registry = new QueryProfileRegistry();
        QueryProfileType rootType = new QueryProfileType("root");
        rootType.inherited().add(registry.getTypeRegistry().getComponent("native"));
        registry.getTypeRegistry().register(rootType);

        QueryProfile root = new QueryProfile("root");
        root.setType(rootType);
        registry.register(root);

        QueryProfile queryBest = new QueryProfile("querybest");
        queryBest.setType(registry.getTypeRegistry().getComponent("model"));
        queryBest.set("queryString", "best", registry);
        registry.register(queryBest);

        CompiledQueryProfileRegistry cRegistry = registry.compile();

        Query query = new Query(HttpRequest.createTestRequest("?query=overrides&model=querybest", Method.GET), cRegistry.getComponent("root"));
        assertEquals("overrides", query.properties().get("model.queryString"));
        assertEquals("WEAKAND(100) overrides", query.getModel().getQueryTree().toString());
    }
Test using the profile to set the query to execute

@author bratseth
container-search/src/test/java/com/yahoo/search/query/profile/test/QueryFromProfileTestCase.java