Last active
April 10, 2018 13:56
-
-
Save alexandre-touret/391305e01510e65703a26c46c2e233f5 to your computer and use it in GitHub Desktop.
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 DbRouterBuilderTest extends CamelSpringTestSupport { | |
@Override | |
@Before | |
public void setUp() throws Exception { | |
super.setUp(); | |
Class.forName("org.hsqldb.jdbcDriver"); | |
context().getRouteDefinitions().get(0).adviceWith(context(), new AdviceWithRouteBuilder() { | |
@Override | |
public void configure() throws Exception { | |
mockEndpoints("file*"); | |
} | |
}); | |
} | |
@Override | |
protected AbstractApplicationContext createApplicationContext() { | |
AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(); | |
annotationConfigApplicationContext.register(ApplicationConfig.class); | |
return annotationConfigApplicationContext; | |
} | |
@Test | |
public void it_should_receive_an_address() throws Exception { | |
Address address = new Address("John Doe", "john@doe.com"); | |
MockEndpoint mockEndpoint = getMockEndpoint("mock:file:target/test"); | |
mockEndpoint.setExpectedCount(1); | |
mockEndpoint.allMessages().body().convertToString().contains("john@doe.com"); | |
template.sendBody("jpa://samples.camel.model.Address?consumeDelete=false", address); | |
assertMockEndpointsSatisfied(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment