use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class FromFtpNotDownloadTest method testNotDownload.
@Test
public void testNotDownload() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
mock.message(0).body().isNull();
mock.message(0).header(Exchange.FILE_NAME).isEqualTo("hello.txt");
mock.assertIsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class FromFtpPassiveModeTest method testFtpPassiveMode.
@Test
public void testFtpPassiveMode() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello World");
mock.assertIsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class FromFtpPreMoveDeleteTest method testPreMoveDelete.
@Test
public void testPreMoveDelete() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
mock.expectedBodiesReceived("Hello World this file will be moved");
mock.assertIsSatisfied();
// and file should be deleted
Thread.sleep(1000);
File file = new File(FTP_ROOT_DIR + "/movefile/work/hello.txt");
assertFalse("The file should have been deleted", file.exists());
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class FromFtpRemoteFileSortByIgnoreCaseExpressionTest method testSortFilesNoCaseReverse.
@Test
public void testSortFilesNoCaseReverse() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from(getFtpUrl() + "&sortBy=reverse:ignoreCase:file:name").to("mock:nocasereverse");
}
});
context.start();
MockEndpoint nocasereverse = getMockEndpoint("mock:nocasereverse");
nocasereverse.expectedBodiesReceived("Hello Paris", "Hello London", "Hello Copenhagen");
assertMockEndpointsSatisfied();
}
use of org.apache.camel.component.mock.MockEndpoint in project camel by apache.
the class FromFtpRemoteFileSortByNestedExpressionTest method testSortFiles.
@Test
public void testSortFiles() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from(getFtpUrl() + "&sortBy=file:ext;file:name").to("mock:result");
}
});
context.start();
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello Dublin", "Hello London", "Hello Paris", "Hello Copenhagen");
assertMockEndpointsSatisfied();
}
Aggregations