SecurityManager securityManager = new SecurityManager(mock(Broker.class), false);
VirtualHost virtualHost = mock(VirtualHost.class);
when(virtualHost.getName()).thenReturn(hostName);
when(virtualHost.getSecurityManager()).thenReturn(securityManager);
DefaultExchangeFactory factory = new DefaultExchangeFactory(virtualHost);
return factory.createExchange("amp.direct", "direct", false, false);
}
public static SimpleAMQQueue createQueue(String queueName, VirtualHost virtualHost) throws AMQException
{
SimpleAMQQueue queue = (SimpleAMQQueue) virtualHost.createQueue(UUIDGenerator.generateRandomUUID(), queueName, false, null,