// Test config
VirtualHostRegistry virtualHostRegistry = reg.getVirtualHostRegistry();
VirtualHost virtualHost = virtualHostRegistry.getVirtualHost("test");
AMQCodecFactory codecFactory = new AMQCodecFactory(true);
TestIoSession iosession = new TestIoSession();
iosession.setAddress("127.0.0.1");
AMQProtocolSession session = new AMQMinaProtocolSession(iosession, virtualHostRegistry, codecFactory);
assertFalse(reg.getAccessManager().authoriseConnect(session, virtualHost));
iosession.setAddress("127.1.2.3");
session = new AMQMinaProtocolSession(iosession, virtualHostRegistry, codecFactory);
assertTrue(reg.getAccessManager().authoriseConnect(session, virtualHost));
}