public void testEndpointConfig() throws MuleException
{
MuleClient muleClient = new MuleClient(muleContext);
ImmutableEndpoint endpoint1 = (ImmutableEndpoint) muleClient.getProperty("inboundEndpoint1");
EndpointURI url1 = endpoint1.getEndpointURI();
assertEquals("sftp", url1.getScheme());
assertEquals("foobar-host", url1.getHost());
assertEquals(4243, url1.getPort());
assertEquals("passw0rd", url1.getPassword());
assertEquals("user42", url1.getUser());
assertEquals("sftp://user42:passw0rd@foobar-host:4243/data", url1.getUri().toString());
// Verify that both endpoints in the config are equal
ImmutableEndpoint endpoint2 = (ImmutableEndpoint) muleClient.getProperty("inboundEndpoint2");
EndpointURI url2 = endpoint2.getEndpointURI();
assertEquals("sftp", url2.getScheme());
assertEquals("foobar-host", url2.getHost());
assertEquals(4243, url2.getPort());
assertEquals("passw0rd", url2.getPassword());
assertEquals("user42", url2.getUser());
assertEquals(url1.getUri().toString(), url2.getUri().toString());
ImmutableEndpoint outboundEndpoint1 = (ImmutableEndpoint) muleClient.getProperty("outboundEndpoint1");
ImmutableEndpoint outboundEndpoint2 = (ImmutableEndpoint) muleClient.getProperty("outboundEndpoint2");
SftpUtil oUtil1 = new SftpUtil(outboundEndpoint1);