This commit is contained in:
parent
f63fbeca4f
commit
8af3dd780f
|
@ -20,8 +20,8 @@ public class DynamicRouterBean {
|
|||
return "mock:directDynamicRouter";
|
||||
} else if (body.equalsIgnoreCase("seda") && invoked == 1) {
|
||||
return "mock:sedaDynamicRouter";
|
||||
} else if (body.equalsIgnoreCase("book") && invoked == 1) {
|
||||
return "mock:bookDynamicRouter";
|
||||
} else if (body.equalsIgnoreCase("file") && invoked == 1) {
|
||||
return "mock:fileDynamicRouter";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ public class DynamicRouterRouteUnitTest extends CamelTestSupport {
|
|||
|
||||
template.send("direct:dynamicRouter", exchange -> exchange.getIn()
|
||||
.setBody("mock"));
|
||||
context.start();
|
||||
MockEndpoint.assertIsSatisfied(context);
|
||||
}
|
||||
|
||||
|
@ -45,18 +44,17 @@ public class DynamicRouterRouteUnitTest extends CamelTestSupport {
|
|||
|
||||
template.send("direct:dynamicRouter", exchange -> exchange.getIn()
|
||||
.setBody("seda"));
|
||||
|
||||
MockEndpoint.assertIsSatisfied(context);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenDynamicRouter_whenMockEndpointExpectedMessageCountOneAndBookAsMessageBody_thenMessageSentToDynamicRouter() throws InterruptedException {
|
||||
|
||||
MockEndpoint mockDynamicEndpoint = getMockEndpoint("mock:bookDynamicRouter");
|
||||
MockEndpoint mockDynamicEndpoint = getMockEndpoint("mock:fileDynamicRouter");
|
||||
mockDynamicEndpoint.expectedMessageCount(1);
|
||||
|
||||
template.send("direct:dynamicRouter", exchange -> exchange.getIn()
|
||||
.setBody("book"));
|
||||
.setBody("file"));
|
||||
MockEndpoint.assertIsSatisfied(context);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue