Configuration config = new PropertiesConfiguration();
VirtualHostConfiguration configuration = new VirtualHostConfiguration(virtualHostName, config, broker);
final org.apache.qpid.server.model.VirtualHost virtualHost = mock(org.apache.qpid.server.model.VirtualHost.class);
when(virtualHost.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.STORE_TYPE))).thenReturn(TestMemoryMessageStore.TYPE);
VirtualHost host = new StandardVirtualHostFactory().createVirtualHost(_virtualHostRegistry, mock(StatisticsGatherer.class), new SecurityManager(mock(Broker.class), false), configuration,
virtualHost);
_virtualHostRegistry.registerVirtualHost(host);
return host;
}