Map<String, FtpClient> clients = beanDefinitionContext.getBeansOfType(FtpClient.class);
Assert.assertEquals(clients.size(), 4);
// 1st ftp client
FtpClient ftpClient = clients.get("ftpClient1");
Assert.assertEquals(ftpClient.getEndpointConfiguration().getHost(), "localhost");
Assert.assertEquals(ftpClient.getEndpointConfiguration().getPort(), new Integer(22222));
Assert.assertEquals(ftpClient.getEndpointConfiguration().getCorrelator().getClass(), DefaultMessageCorrelator.class);
Assert.assertEquals(ftpClient.getEndpointConfiguration().getTimeout(), 5000L);
// 2nd ftp client
ftpClient = clients.get("ftpClient2");
Assert.assertEquals(ftpClient.getEndpointConfiguration().getHost(), "localhost");
Assert.assertEquals(ftpClient.getEndpointConfiguration().getPort(), new Integer(22222));
Assert.assertEquals(ftpClient.getEndpointConfiguration().getCorrelator().getClass(), DefaultMessageCorrelator.class);
Assert.assertEquals(ftpClient.getEndpointConfiguration().getUser(), "user");
Assert.assertEquals(ftpClient.getEndpointConfiguration().getPassword(), "consol");
Assert.assertEquals(ftpClient.getEndpointConfiguration().getTimeout(), 10000L);
// 3rd ftp client
ftpClient = clients.get("ftpClient3");
Assert.assertEquals(ftpClient.getEndpointConfiguration().getHost(), "localhost");
Assert.assertEquals(ftpClient.getEndpointConfiguration().getPort(), new Integer(22222));
Assert.assertNotNull(ftpClient.getEndpointConfiguration().getCorrelator());
Assert.assertEquals(ftpClient.getEndpointConfiguration().getCorrelator(), beanDefinitionContext.getBean("replyMessageCorrelator"));
// 4th ftp client
ftpClient = clients.get("ftpClient4");
Assert.assertNotNull(ftpClient.getActor());
Assert.assertEquals(ftpClient.getActor(), beanDefinitionContext.getBean("testActor", TestActor.class));
Assert.assertEquals(ftpClient.getEndpointConfiguration().getPollingInterval(), 250L);
}