EventLogger eventLogger = mock(EventLogger.class);
SecurityManager securityManager = mock(SecurityManager.class);
TaskExecutor executor = CurrentThreadTaskExecutor.newStartedInstance();
SystemConfig systemConfig = mock(SystemConfig.class);
ConfiguredObjectFactory objectFactory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
when(systemConfig.getObjectFactory()).thenReturn(objectFactory);
when(systemConfig.getModel()).thenReturn(objectFactory.getModel());
when(systemConfig.getEventLogger()).thenReturn(eventLogger);
when(systemConfig.getTaskExecutor()).thenReturn(executor);
Broker broker = mock(Broker.class);
when(broker.getObjectFactory()).thenReturn(objectFactory);
when(broker.getModel()).thenReturn(objectFactory.getModel());
when(broker.getSecurityManager()).thenReturn(securityManager);
when(broker.getCategoryClass()).thenReturn(Broker.class);
when(broker.getParent(eq(SystemConfig.class))).thenReturn(systemConfig);
when(broker.getTaskExecutor()).thenReturn(executor);
_virtualHostNode = mock(VirtualHostNode.class);
when(_virtualHostNode.getParent(Broker.class)).thenReturn(broker);
when(_virtualHostNode.getObjectFactory()).thenReturn(objectFactory);
when(_virtualHostNode.getConfigurationStore()).thenReturn(mock(DurableConfigurationStore.class));
when(_virtualHostNode.getModel()).thenReturn(objectFactory.getModel());
when(_virtualHostNode.getCategoryClass()).thenReturn(VirtualHostNode.class);
when(_virtualHostNode.getTaskExecutor()).thenReturn(executor);
}