protected void verifyInAndOutFiles(String inboundEndpointName,
String outboundEndpointName,
boolean shouldInboundFileStillExist,
boolean shouldOutboundFileExist) throws IOException
{
SftpClient sftpClientInbound = getSftpClient(inboundEndpointName);
SftpClient sftpClientOutbound = getSftpClient(outboundEndpointName);
try
{
ImmutableEndpoint inboundEndpoint = muleContext.getRegistry().lookupObject(inboundEndpointName);
ImmutableEndpoint outboundEndpoint = muleContext.getRegistry().lookupObject(outboundEndpointName);
if (shouldInboundFileStillExist)
{
assertTrue("The inbound file should still exist",
super.verifyFileExists(sftpClientInbound, inboundEndpoint.getEndpointURI(), FILENAME));
}
else
{
assertFalse("The inbound file should have been deleted",
super.verifyFileExists(sftpClientInbound, inboundEndpoint.getEndpointURI(), FILENAME));
}
if (shouldOutboundFileExist)
{
assertTrue("The outbound file should exist",
super.verifyFileExists(sftpClientOutbound, outboundEndpoint.getEndpointURI(), FILENAME));
}
else
{
assertFalse("The outbound file should have been deleted",
super.verifyFileExists(sftpClientOutbound, outboundEndpoint.getEndpointURI(), FILENAME));
}
}
finally
{
sftpClientInbound.disconnect();
sftpClientOutbound.disconnect();
}
}