Hi Rick,

You can find an example on how to use AdviceWith along with Arquillian and CDI 
here:

https://github.com/apache/camel/blob/camel-2.24.1/components/camel-cdi/src/test/java/org/apache/camel/cdi/test/AdvisedRouteTest.java#L84-L92

The trick is to used a context that is not auto started: 

https://github.com/apache/camel/blob/ffbe4efdc9e065b076a3952631facae46a1e25f3/components/camel-cdi/src/test/java/org/apache/camel/cdi/bean/ManualStartupCamelContext.java

--
Antonin

> On 3 Jul 2019, at 17:35, Rick Wagner <rwag...@redhat.com> wrote:
> 
> Hello Camel Riders,
> 
> I've recently spent some time working on Camel testing, but find the
> documentation a bit confusing when Camel is used with Arquillian.
> 
> The docs describe how 'AdviceWith' [1] can be used, and how
> isUseAdviceWith() can be used to let Camel know you are advising a route.
> The problem is that something like Arquillian can insert another layer of
> behavior into the scenario, the user may be unaware.  (The particular use
> case:  'AdviceWith' is ignored when using Arquillian, because Arquillian
> causes the route to be deployed and started before the unit test can apply
> 'AdviceWith'.)
> 
> Does anyone else find this confusing?
> 
> Thank you,
> 
> Rick
> 
> P.S.  I'd be glad to supply a PR or other suggested change to the Camel
> site, but I'm afraid I find the docs change process confusing as well.
> I've cloned the Camel repo, but can't seem to find the source for the
> article at [1], perhaps it's not on the source tip.  If I'm missing the
> 'right way' to do it, please let me know.
> 
> [1] https://camel.apache.org/advicewith.html

Reply via email to