Since I hide my embarrassments in public I thought I'd best share with anyone else with brain freeze.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeTest extends CamelTestSupport { | |
@Override | |
protected RouteBuilder createRouteBuilder() throws Exception { | |
return new RouteBuilder() { | |
@Override | |
public void configure() throws Exception { | |
from("direct:findAll") | |
.to("mongodb:myConnectionBean?database=flights&collection=tickets&operation=findAll") | |
.to("mock:resultFindAll"); | |
} | |
}; | |
} | |
@Override | |
protected JndiRegistry createRegistry() throws Exception { | |
JndiRegistry reg = new JndiRegistry(createJndiContext()); | |
Mongo connectionBean = new Mongo("localhost", 27017); | |
reg.bind("myConnectionBean", connectionBean); | |
return reg; | |
} | |
@Test | |
public void testSomething() throws InterruptedException { | |
// test something here | |
} | |
} |
Don't forget you need the camel-mongodb artifact in your pom.xml file. Good luck fellow travellers.
No comments:
Post a Comment