use of org.reactivestreams.Subscriber in project camel by apache.
the class EventTypeTest method testOnErrorHeaderNotForwarded.
@Test
public void testOnErrorHeaderNotForwarded() throws Exception {
new RouteBuilder() {
@Override
public void configure() throws Exception {
from("reactive-streams:numbers").to("mock:endpoint");
}
}.addRoutesToCamelContext(context);
Subscriber<Integer> numbers = CamelReactiveStreams.get(context).streamSubscriber("numbers", Integer.class);
context.start();
RuntimeException ex = new RuntimeException("1");
Flowable.just(1).map(n -> {
if (n == 1) {
throw ex;
}
return n;
}).subscribe(numbers);
MockEndpoint endpoint = getMockEndpoint("mock:endpoint");
endpoint.expectedMessageCount(0);
endpoint.assertIsSatisfied(200);
}
Aggregations