@Test
public void testCantCreateTempDirectory() throws Exception
{
Runtime.getRuntime().exec(new String[]{"chmod", "320", OUTBOUND_ENDPOINT_DIR});
final CountDownLatch exceptionLatch = new CountDownLatch(1);
muleContext.registerListener(new LatchDownExceptionListener(exceptionLatch));
MuleClient muleClient = muleContext.getClient();
muleClient.dispatch("sftp://localhost:" + port.getNumber() + "/" + INBOUND_ENDPOINT_NAME,
TEST_MESSAGE, MESSAGE_PROPERTIES);
assertTrue(exceptionLatch.await(EXCEPTION_TIMEOUT, TimeUnit.MILLISECONDS));