use of org.mule.runtime.core.internal.config.bootstrap.TestBootstrapServiceDiscoverer in project mule by mulesoft.
the class SimpleRegistryBootstrapTransformersTestCase method registeringTransformersWithCustomKey.
@Test
public void registeringTransformersWithCustomKey() throws MuleException {
Properties properties = new Properties();
properties.setProperty("core.transformer.1", ExpectedKeyTransformer.class.getName());
properties.setProperty("custom1", CustomKeyTransformer.class.getName());
TestTransformerResolver transformerResolver = new TestTransformerResolver();
((MuleContextWithRegistries) muleContext).getRegistry().registerObject("testTransformerResolver", transformerResolver);
final BootstrapServiceDiscoverer bootstrapServiceDiscoverer = new TestBootstrapServiceDiscoverer(properties);
muleContext.setBootstrapServiceDiscoverer(bootstrapServiceDiscoverer);
SimpleRegistryBootstrap registryBootstrap = new SimpleRegistryBootstrap(APP, muleContext);
registryBootstrap.initialise();
assertEquals(2, transformerResolver.getTransformersCount());
assertTrue(transformerResolver.contains(ExpectedKeyTransformer.class));
assertTrue(transformerResolver.contains(CustomKeyTransformer.class));
}
Aggregations