我试图弄清楚如何摆脱我的JUnit测试中出现的警告。测试扩展了CamelTestSupport,但所有测试方法都抛出
WARN : Caught unhandled exception while processing ExchangedId:...
java.lang.IllegalArgumentException: connectionFactory must be specified
任何想法如何解决这个问题?
答案 0 :(得分:3)
如果您使用的是JMS / AMQ,那么您可能需要添加它来设置您的组件/ connectionFactory ......
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
String url = "vm://test-broker?broker.persistent=false&broker.useJmx=false";
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
camelContext.addComponent("activemq", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
return camelContext;
}