Hi

Okay so that annotation @ExcludeRoutes is for non spring boot testing
(eg old school spring apps).

For spring-boot you need to use the java-routes-include-pattern and
java-routes-exclude-pattern
properties.

These are documented a bit at
https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/docs/spring-boot.adoc

On Wed, Feb 13, 2019 at 1:30 PM Louis Becker <[email protected]> wrote:
>
> Hi
>
> I am developing a camel 2.22.1 in spring using spring boot 2.0.7.
>
> I am trying to surprise "noisy" routes during testing, but it seems like my 
> @ExcludeRoutes array of classes is being ignored. I expect only on route to 
> run (see <code>), but as you will see from the extract from the <log> that 
> many of the listed routes still run.
>
> Can someone tell me what I should be doing differently? Google did not help.
>
> Regards
> Louis
>
> <code>
>
> @Slf4j
> @ActiveProfiles("mock")
> @RunWith(CamelSpringBootRunner.class)
> @SpringBootTest
> @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
> @MockEndpoints
> @ExcludeRoutes({
>         EmydexSalesOrderOutputRoute.class,
>         SageX3SalesInvoiceInputRoute.class,
>         SageX3SalesOrderOutputRoute.class,
>         SalesInvoiceRouter.class,
>         SalesOrderRouter.class,
>         SavePrettyXmlRoute.class,
>         UpdateSageX3InvoiceSentStatusRoute.class,
>         WoermannSalesInvoiceOutputRoute.class,
>         WoermannSalesInvoiceOutputRoute.class,
>         WoermannSalesOrderInputRoute.class})
> public class PriceListOutputRouteMockTest {
>
> </code>
>
> <log>
> 2019-02-13 14:23:09.135  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route1 started and 
> consuming from: direct://emydexSalesOrderOutputRouteInput
> 2019-02-13 14:23:09.135  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route2 started and 
> consuming from: direct://priceListOutputRouteInput
> 2019-02-13 14:23:09.135  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route3 started and 
> consuming from: direct://sageX3SalesInvoiceInputRouteInput
> 2019-02-13 14:23:09.135  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route4 started and 
> consuming from: direct://sageX3SalesOrderOutputRouteInput
> 2019-02-13 14:23:09.150  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route5 started and 
> consuming from: direct://salesInvoiceRouterInput
> 2019-02-13 14:23:09.150  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route6 started and 
> consuming from: direct://salesOrderRouterInput
> 2019-02-13 14:23:09.150  INFO 13240 --- [           main] 
> o.a.camel.spring.SpringCamelContext      : Route: route7 started and 
> consuming from: direct://woermannCustomInvoiceSendRouteInput
> </log>
>
>
>


-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to