public void testGatewayHubFactoryBean() throws Exception {
GatewayHubFactoryBean gwhfb = ctx.getBean("&gateway-hub", GatewayHubFactoryBean.class);
List<GatewayProxy> gateways = TestUtils.readField("gateways", gwhfb);
assertNotNull(gateways);
assertEquals(2, gateways.size());
GatewayProxy gwp = gateways.get(0);
assertEquals("gateway", gwp.getId());
assertTrue(gwp.getListeners().get(0) instanceof GatewayListener);
gwp = gateways.get(1);
assertEquals("gateway2", gwp.getId());
List<GatewayProxy.GatewayEndpoint> endpoints = gwp.getEndpoints();
assertEquals(2, endpoints.size());
GatewayProxy.GatewayEndpoint endpoint;
endpoint = endpoints.get(0);
assertEquals("endpoint1", endpoint.getId());