private ConfigModelContext(ApplicationType applicationType,
                               DeployState deployState,
                               VespaModel vespaModel,
                               ConfigModelRepoAdder configModelRepoAdder,
                               TreeConfigProducer<AnyConfigProducer> parent,
                               String producerId) {
        this.applicationType = applicationType;
        this.deployState = deployState;
        this.vespaModel = vespaModel;
        this.configModelRepoAdder = configModelRepoAdder;
        this.parent = parent;
        this.producerId = producerId;
    }
@Test
    void testConfigModelContext() {
        MockRoot root = new MockRoot();
        String id = "foobar";
        ApplicationPackage pkg = new MockApplicationPackage.Builder()
                .withServices("<services version=\"1.0\"><admin version=\"2.0\" /></services>")
                .build();
        DeployState deployState = DeployState.createTestState(pkg);
        DeployLogger logger = deployState.getDeployLogger();
        ConfigModelContext ctx = ConfigModelContext.create(deployState, null, null, root, id);
        assertEquals(pkg, ctx.getApplicationPackage());
        assertEquals(id, ctx.getProducerId());
        assertEquals(root, ctx.getParentProducer());
        assertEquals(logger, ctx.getDeployLogger());
        ctx = ConfigModelContext.create(root.getDeployState(), null, null, root, id);
        assertEquals(id, ctx.getProducerId());
        assertEquals(root, ctx.getParentProducer());
        TreeConfigProducer newRoot = new MockRoot("bar");
        ctx = ctx.withParent(newRoot);
        assertEquals(id, ctx.getProducerId());
        assertNotEquals(root, ctx.getParentProducer());
        assertEquals(newRoot, ctx.getParentProducer());
    }