@Test
    void testQueryFromProfile1() {
        QueryProfileRegistry registry = new QueryProfileRegistry();
        QueryProfile topLevel = new QueryProfile("topLevel");
        topLevel.setType(registry.getTypeRegistry().getComponent("native"));
        registry.register(topLevel);

        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("?model=querybest", Method.GET), cRegistry.getComponent("topLevel"));
        assertEquals("best", query.properties().get("model.queryString"));
        assertEquals("WEAKAND(100) best", 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