BusLifeCycleListener listener = EasyMock.createMock(BusLifeCycleListener.class);
manager.registerLifeCycleListener(listener);
EasyMock.reset(listener);
listener.preShutdown();
EasyMock.expectLastCall().times(1);
listener.postShutdown();
EasyMock.expectLastCall().times(1);
EasyMock.replay(listener);
AbstractRefreshableApplicationContext context =
(AbstractRefreshableApplicationContext)factory.getApplicationContext();
context.close();