Search in sources :

Example 1 with TestBootstrapServiceDiscoverer

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));
}
Also used : TestBootstrapServiceDiscoverer(org.mule.runtime.core.internal.config.bootstrap.TestBootstrapServiceDiscoverer) TestBootstrapServiceDiscoverer(org.mule.runtime.core.internal.config.bootstrap.TestBootstrapServiceDiscoverer) BootstrapServiceDiscoverer(org.mule.runtime.core.api.config.bootstrap.BootstrapServiceDiscoverer) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

Properties (java.util.Properties)1 Test (org.junit.Test)1 BootstrapServiceDiscoverer (org.mule.runtime.core.api.config.bootstrap.BootstrapServiceDiscoverer)1 TestBootstrapServiceDiscoverer (org.mule.runtime.core.internal.config.bootstrap.TestBootstrapServiceDiscoverer)1