use of org.apache.camel.impl.DefaultEndpoint in project camel by apache.
the class RetryRouteScopedUntilRecipientListIssueTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
context.addEndpoint("fail", new DefaultEndpoint() {
public Producer createProducer() throws Exception {
return new DefaultProducer(this) {
public void process(Exchange exchange) throws Exception {
exchange.setException(new IllegalArgumentException("Damn"));
}
};
}
public Consumer createConsumer(Processor processor) throws Exception {
return null;
}
@Override
protected String createEndpointUri() {
return "fail";
}
public boolean isSingleton() {
return true;
}
});
context.addEndpoint("not-fail", new DefaultEndpoint() {
public Producer createProducer() throws Exception {
return new DefaultProducer(this) {
public void process(Exchange exchange) throws Exception {
// noop
}
};
}
public Consumer createConsumer(Processor processor) throws Exception {
return null;
}
@Override
protected String createEndpointUri() {
return "not-fail";
}
public boolean isSingleton() {
return true;
}
});
return context;
}
Aggregations