use of org.mule.runtime.core.api.config.ConfigurationBuilder in project mule by mulesoft.
the class DefaultMuleContextFactoryTestCase method notifiesMuleContextEvents.
@Test
public void notifiesMuleContextEvents() throws InitialisationException, ConfigurationException {
MuleContextListener listener = mock(MuleContextListener.class);
ConfigurationBuilder configurationBuilder = mock(ConfigurationBuilder.class);
context = mockMuleContext();
context = mockMuleContext();
doAnswer(invocation -> {
listener.onInitialization(context, null);
return null;
}).when(context).initialise();
MuleContextBuilder contextBuilder = mock(MuleContextBuilder.class);
when(contextBuilder.buildMuleContext()).thenReturn(context);
muleContextFactory.addListener(listener);
muleContextFactory.createMuleContext(configurationBuilder, contextBuilder);
InOrder inOrder = inOrder(listener);
inOrder.verify(listener, times(1)).onCreation(context);
inOrder.verify(listener, times(1)).onInitialization(eq(context), any(Registry.class));
}
Aggregations