Map<String, FtpServer> servers = beanDefinitionContext.getBeansOfType(FtpServer.class);
Assert.assertEquals(servers.size(), 4);
// 1st message sender
FtpServer server = servers.get("ftpServer1");
Assert.assertEquals(server.getName(), "ftpServer1");
Assert.assertEquals(server.getPort(), 22222);
Assert.assertFalse(server.isAutoStart());
// 2nd message sender
server = servers.get("ftpServer2");
Assert.assertEquals(server.getName(), "ftpServer2");
Assert.assertEquals(server.getPort(), 22222);
Assert.assertEquals(server.getFtpServer(), beanDefinitionContext.getBean("apacheFtpServer"));
Assert.assertFalse(server.isAutoStart());
// 3rd message sender
server = servers.get("ftpServer3");
Assert.assertEquals(server.getName(), "ftpServer3");
Assert.assertEquals(server.getPort(), 22222);
Assert.assertEquals(server.getUserManager(), beanDefinitionContext.getBean("userManager"));
Assert.assertFalse(server.isAutoStart());
// 4th message sender
server = servers.get("ftpServer4");
Assert.assertEquals(server.getName(), "ftpServer4");
Assert.assertEquals(server.getPort(), 22222);
Assert.assertNotNull(server.getUserManagerProperties().getFile());
Assert.assertFalse(server.isAutoStart());
Assert.assertNotNull(server.getInterceptors());
Assert.assertEquals(server.getInterceptors().size(), 0L);
}