CompiledQueryProfileRegistry extends ComponentRegistry<CompiledQueryProfile> { public CompiledQueryProfile findQueryProfile(String idString) { if (idString == null || idString.isEmpty()) return getComponent("default"); ComponentSpecification id = new ComponentSpecification(idString); CompiledQueryProfile profile = getComponent(id); if (profile != null) return profile; return findPathParentQueryProfile(new ComponentSpecification(idString)); } @Inject  CompiledQueryProfileRegistry(QueryProfilesConfig config);  CompiledQueryProfileRegistry();  CompiledQueryProfileRegistry(QueryProfileTypeRegistry typeRegistry); final void register(CompiledQueryProfile profile); QueryProfileTypeRegistry getTypeRegistry(); CompiledQueryProfile findQueryProfile(String idString); static final CompiledQueryProfileRegistry empty; }
@Test public void registry_can_be_created_from_config() { var config = new QueryProfilesConfig.Builder() .queryprofile(new QueryProfilesConfig.Queryprofile.Builder() .id("profile1") .property(new QueryProfilesConfig.Queryprofile.Property.Builder() .name("hits") .value("5"))) .build(); var registry = new CompiledQueryProfileRegistry(config); var profile1 = registry.findQueryProfile("profile1"); assertEquals("5", profile1.get("hits")); }