private void assertHasMlModels(VespaModel model, Path appDir) {
        ApplicationContainerCluster cluster = model.getContainerClusters().get("container");
        assertNotNull(cluster.getComponentsMap().get(new ComponentId(ModelsEvaluator.class.getName())));

        assertNotNull(cluster.getComponentsMap().get(new ComponentId(ModelsEvaluationHandler.class.getName())));
        assertTrue(cluster.getHandlers().stream()
                .anyMatch(h -> h.getComponentId().toString().equals(ModelsEvaluationHandler.class.getName())));

        RankProfilesConfig.Builder b = new RankProfilesConfig.Builder();
        cluster.getConfig(b);
        RankProfilesConfig config = new RankProfilesConfig(b);

        RankingConstantsConfig.Builder cb = new RankingConstantsConfig.Builder();
        cluster.getConfig(cb);
        RankingConstantsConfig constantsConfig = new RankingConstantsConfig(cb);

        RankingExpressionsConfig.Builder ce = new RankingExpressionsConfig.Builder();
        cluster.getConfig(ce);
        RankingExpressionsConfig expressionsConfig = ce.build();

        OnnxModelsConfig.Builder ob = new OnnxModelsConfig.Builder();
        cluster.getConfig(ob);
        OnnxModelsConfig onnxModelsConfig = new OnnxModelsConfig(ob);

        assertEquals(5, config.rankprofile().size());
        Set<String> modelNames = config.rankprofile().stream().map(v -> v.name()).collect(Collectors.toSet());
        assertTrue(modelNames.contains("xgboost_2_2"));
        assertTrue(modelNames.contains("lightgbm_regression"));
        assertTrue(modelNames.contains("add_mul"));
        assertTrue(modelNames.contains("small_constants_and_functions"));
        assertTrue(modelNames.contains("sqrt"));

        // Compare profile content in a denser format than config:
        StringBuilder sb = new StringBuilder();
        for (RankProfilesConfig.Rankprofile.Fef.Property p : findProfile("small_constants_and_functions", config).property())
            sb.append(p.name()).append(": ").append(p.value()).append("\n");
        assertEquals(profile, sb.toString());

        Map<String, File> fileMap = new HashMap<>();
        for (OnnxModelsConfig.Model onnxModel : onnxModelsConfig.model()) {
            fileMap.put(onnxModel.fileref().value(), appDir.append(onnxModel.fileref().value()).toFile());
        }
        FileAcquirer fileAcquirer = MockFileAcquirer.returnFiles(fileMap);
        ModelsEvaluator evaluator = new ModelsEvaluator(config, constantsConfig, expressionsConfig, onnxModelsConfig, fileAcquirer);

        assertEquals(5, evaluator.models().size());

        Model xgboost = evaluator.models().get("xgboost_2_2");
        assertNotNull(xgboost);
        assertNotNull(xgboost.evaluatorOf());
        assertNotNull(xgboost.evaluatorOf("xgboost_2_2"));

        Model lightgbm = evaluator.models().get("lightgbm_regression");
        assertNotNull(lightgbm);
        assertNotNull(lightgbm.evaluatorOf());
        assertNotNull(lightgbm.evaluatorOf("lightgbm_regression"));

        Model add_mul = evaluator.models().get("add_mul");
        assertNotNull(add_mul);
        assertEquals(2, add_mul.functions().size());
        assertNotNull(add_mul.evaluatorOf("output1"));
        assertNotNull(add_mul.evaluatorOf("output2"));
        assertNotNull(add_mul.evaluatorOf("default.output1"));
        assertNotNull(add_mul.evaluatorOf("default.output2"));
        assertNotNull(add_mul.evaluatorOf("default", "output1"));
        assertNotNull(add_mul.evaluatorOf("default", "output2"));
        assertNotNull(evaluator.evaluatorOf("add_mul", "output1"));
        assertNotNull(evaluator.evaluatorOf("add_mul", "output2"));
        assertNotNull(evaluator.evaluatorOf("add_mul", "default.output1"));
        assertNotNull(evaluator.evaluatorOf("add_mul", "default.output2"));
        assertNotNull(evaluator.evaluatorOf("add_mul", "default", "output1"));
        assertNotNull(evaluator.evaluatorOf("add_mul", "default", "output2"));
        assertEquals(TensorType.fromSpec("tensor<float>(d0[1])"), add_mul.functions().get(0).getArgumentType("input1"));
        assertEquals(TensorType.fromSpec("tensor<float>(d0[1])"), add_mul.functions().get(0).getArgumentType("input2"));

        Model sqrt = evaluator.models().get("sqrt");
        assertNotNull(sqrt);
        assertEquals(1, sqrt.functions().size());
        assertNotNull(sqrt.evaluatorOf());
        assertNotNull(sqrt.evaluatorOf("out_layer_1_1"));  // converted from "out/layer/1:1"
        assertNotNull(evaluator.evaluatorOf("sqrt"));
        assertNotNull(evaluator.evaluatorOf("sqrt", "out_layer_1_1"));
        assertEquals(TensorType.fromSpec("tensor<float>(d0[1])"), sqrt.functions().get(0).getArgumentType("input"));
    }
Tests that we do not load models (which would waste memory) when not requested
config-model/src/test/java/com/yahoo/vespa/model/ml/ModelEvaluationTest.java