Annotation Type AdviceRouteMapping


  • @Documented
    @Retention(RUNTIME)
    public @interface AdviceRouteMapping
    A specific annotation allowing to define a mapping between a route represented by its id and advice represented by a subclass of RouteBuilder to use to advice the route. To advice a route, an instance of RouteBuilder needs to be created and for this the default constructor is used, so make sure that a default constructor exists.

    This annotation is only meant to be used inside the annotation CamelMainTest to define all the advices to consider.

    In the next example, the annotation CamelMainTest on the test class SomeTest indicates that the RouteBuilder of type ReplaceDirectWithMockBuilder should be used to advise the route whose identifier is main-route.

     
    
     @CamelMainTest(advices = @AdviceRouteMapping(route = "main-route", advice = ReplaceDirectWithMockBuilder.class))
     class SomeTest {
         // The rest of the test class
     }
     
     
    See Also:
    RouteBuilder, CamelMainTest
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class<? extends org.apache.camel.builder.RouteBuilder> advice  
      String route  
    • Element Detail

      • route

        String route
        Returns:
        the id of the route to advice.
      • advice

        Class<? extends org.apache.camel.builder.RouteBuilder> advice
        Returns:
        the class of the specific route builder that is used to advice the route.