簡體   English   中英

Apache Camel JUnit測試警告

[英]Apache Camel JUnit test warnings

我試圖弄清楚如何擺脫在JUnit測試中顯示的警告。 測試擴展了CamelTestSupport,但所有的測試方法都拋出了

WARN : Caught unhandled exception while processing ExchangedId:...

java.lang.IllegalArgumentException: connectionFactory must be specified

任何想法如何解決這個問題?

如果你正在使用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;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM