@Test
public void getStreamCloserService() throws Exception
{
DefaultMuleContext context = (DefaultMuleContext) new DefaultMuleContextFactory().createMuleContext();
StreamCloserService serviceFromRegistry = context.getRegistry().lookupObject(MuleProperties.OBJECT_MULE_STREAM_CLOSER_SERVICE);
MuleRegistryHelper registry = spy((MuleRegistryHelper) context.getRegistry());
context.setMuleRegistry(registry);
StreamCloserService streamCloserService = context.getStreamCloserService();
assertNotNull(streamCloserService);
assertSame(serviceFromRegistry, streamCloserService);
// test that subsequent invocations consistently returns the same object