use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class ZipFileDataFormatTest method testZipToFileWithoutFileName.
@Test
public void testZipToFileWithoutFileName() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
String[] files = TEST_DIR.list();
assertTrue(files == null || files.length == 0);
MockEndpoint mock = getMockEndpoint("mock:intercepted");
mock.expectedMessageCount(1);
template.sendBody("direct:zipToFile", TEXT);
assertMockEndpointsSatisfied();
// use builder to ensure the exchange is fully done before we check for file exists
assertTrue("The exchange is not done in time.", notify.matches(5, TimeUnit.SECONDS));
Exchange exchange = mock.getReceivedExchanges().get(0);
File file = new File(TEST_DIR, exchange.getIn().getMessageId() + ".zip");
assertTrue("The file should exist.", file.exists());
assertArrayEquals("Get a wrong message content.", getZippedText(exchange.getIn().getMessageId()), getBytes(file));
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class ZipkinTimerRouteScribe method testZipkinRoute.
@Test
public void testZipkinRoute() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).from("seda:timer").whenDone(1).create();
template.sendBody("direct:start", "Hello Timer");
assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class ZipkinABCRouteTest method testZipkinRoute.
@Test
public void testZipkinRoute() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
template.requestBody("direct:start", "Hello World");
assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class ZipkinABCRouteScribe method testZipkinRoute.
@Test
public void testZipkinRoute() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
template.requestBody("direct:start", "Hello World");
assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class ZipkinMulticastRouteScribe method testZipkinRoute.
@Test
public void testZipkinRoute() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(1).create();
template.requestBody("direct:start", "Hello World");
assertTrue(notify.matches(30, TimeUnit.SECONDS));
}
Aggregations