use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class RetryRouteScopedUntilRecipientListIssueTest method testRetryUntilRecipientListOkAndFail.
public void testRetryUntilRecipientListOkAndFail() throws Exception {
invoked.set(0);
NotifyBuilder event = event().whenFailed(1).create();
getMockEndpoint("mock:result").expectedMessageCount(0);
getMockEndpoint("mock:foo").expectedMessageCount(1);
template.sendBodyAndHeader("seda:start", "Hello World", "recipientListHeader", "direct:foo,fail");
assertMockEndpointsSatisfied();
// wait until its done before we stop and check that retry was invoked
boolean matches = event.matches(10, TimeUnit.SECONDS);
assertTrue(matches);
context.stop();
assertEquals(3, invoked.get());
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class RetryRouteScopedUntilRecipientListIssueTest method testRetryUntilRecipientListFailOnly.
public void testRetryUntilRecipientListFailOnly() throws Exception {
invoked.set(0);
NotifyBuilder event = event().whenDone(1).create();
getMockEndpoint("mock:result").expectedMessageCount(0);
getMockEndpoint("mock:foo").expectedMessageCount(0);
template.sendBodyAndHeader("seda:start", "Hello World", "recipientListHeader", "fail");
assertMockEndpointsSatisfied();
// wait until its done before we stop and check that retry was invoked
boolean matches = event.matches(10, TimeUnit.SECONDS);
assertTrue(matches);
context.stop();
assertEquals(3, invoked.get());
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class RetryRouteScopedUntilRecipientListIssueTest method testRetryUntilRecipientFailAndNotFail.
public void testRetryUntilRecipientFailAndNotFail() throws Exception {
invoked.set(0);
NotifyBuilder event = event().whenDone(1).create();
getMockEndpoint("mock:result").expectedMessageCount(0);
getMockEndpoint("mock:foo").expectedMinimumMessageCount(0);
template.sendBodyAndHeader("seda:start", "Hello World", "recipientListHeader", "fail,not-fail");
assertMockEndpointsSatisfied();
// wait until its done before we stop and check that retry was invoked
boolean matches = event.matches(10, TimeUnit.SECONDS);
assertTrue(matches);
context.stop();
assertEquals(3, invoked.get());
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class RetryRouteScopedUntilRecipientListIssueTest method testRetryUntilRecipientListFailAndOk.
public void testRetryUntilRecipientListFailAndOk() throws Exception {
invoked.set(0);
NotifyBuilder event = event().whenDone(1).create();
getMockEndpoint("mock:result").expectedMessageCount(0);
getMockEndpoint("mock:foo").expectedMinimumMessageCount(0);
template.sendBodyAndHeader("seda:start", "Hello World", "recipientListHeader", "fail,direct:foo");
assertMockEndpointsSatisfied();
// wait until its done before we stop and check that retry was invoked
boolean matches = event.matches(10, TimeUnit.SECONDS);
assertTrue(matches);
context.stop();
assertEquals(3, invoked.get());
}
use of org.apache.camel.builder.NotifyBuilder in project camel by apache.
the class NotifyBuilderExactlyDoneSplitterWhereSentToIssueTest method testReceiveTiAnalyticsArrayOfJsonEvents.
public void testReceiveTiAnalyticsArrayOfJsonEvents() {
NotifyBuilder notifier = new NotifyBuilder(context).wereSentTo("stub:direct:somewhere").whenExactlyDone(7).create();
template.sendBody("direct:split", "A,B,C,D,E,F,G");
assertTrue(notifier.matches(10, TimeUnit.SECONDS));
}
Aggregations