LegacyConfigModelBuilder extends ConfigModelBuilder<MODEL> { @Override public MODEL build(ConfigModelInstanceFactory<MODEL> factory, Element spec, ConfigModelContext context) { VespaDomBuilder.DomSimpleConfigProducerBuilder builder = new VespaDomBuilder.DomSimpleConfigProducerBuilder(context.getProducerId()); AbstractConfigProducer producer = builder.build(context.getDeployState(), context.getParentProducer(), spec); return super.build(factory, spec, context.withParent(producer)); } LegacyConfigModelBuilder(Class<MODEL> configModelClass); @Override MODEL build(ConfigModelInstanceFactory<MODEL> factory, Element spec, ConfigModelContext context);  }
@Test public void testThatProducerIsInserted() { String services = "<foo><config name=\"bar.foo\"><key>value</key></config></foo>"; ModelBuilder builder = new ModelBuilder(); Model model = builder.build(DeployState.createTestState(new MockApplicationPackage.Builder().withServices(services).build()), null, null, new MockRoot(), XML.getDocument(services).getDocumentElement()); assertThat(model.getContext().getParentProducer().getUserConfigs().size(), is(1)); }