ArtifactManager artifactManager = new DefaultArtifactManager();
ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, mockRepository);
ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET, bundleContext);
bundleContext.setConfigurationManager(configurationManager);
AbstractName moduleName = naming.createRootName(environment.getConfigId(), "foo", "bar");
DeploymentContext context = new DeploymentContext(outFile, null, environment, moduleName, ConfigurationModuleType.CAR, naming, configurationManager, Collections.<Repository>singleton(mockRepository), bundleContext);
context.initializeConfiguration();
gbeanBuilder.build(plan, context, context);
Set gbeanNames = context.getGBeanNames();
assertEquals(1, gbeanNames.size());
AbstractName beanName = (AbstractName) gbeanNames.iterator().next();
GBeanData data = context.getGBeanInstance(beanName);
FooBarBean fooBarBean = (FooBarBean) data.getAttribute("fooBarBean");
assertNotNull(fooBarBean);
assertEquals("foo", fooBarBean.getFoo());
assertEquals(10, fooBarBean.getBar());
FooBarBean inner = fooBarBean.getBean();