diff --git a/apache-libraries-2/src/main/java/com/baeldung/dynamicrouter/DynamicRouterBean.java b/apache-libraries-2/src/main/java/com/baeldung/dynamicrouter/DynamicRouterBean.java index 3df861d2b2..8bc455353b 100644 --- a/apache-libraries-2/src/main/java/com/baeldung/dynamicrouter/DynamicRouterBean.java +++ b/apache-libraries-2/src/main/java/com/baeldung/dynamicrouter/DynamicRouterBean.java @@ -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; } diff --git a/apache-libraries-2/src/test/java/dynamicrouter/DynamicRouterRouteUnitTest.java b/apache-libraries-2/src/test/java/dynamicrouter/DynamicRouterRouteUnitTest.java index fa8cab99a0..6401fa4be2 100644 --- a/apache-libraries-2/src/test/java/dynamicrouter/DynamicRouterRouteUnitTest.java +++ b/apache-libraries-2/src/test/java/dynamicrouter/DynamicRouterRouteUnitTest.java @@ -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); }