Hi

That string you pass can be regex. 

So if you got something like jdbc:blah?option1=dsff&option2=sdf…

You can pass any of the following
jdbc.*
jdbc:blah.*

And to get the reference to the mockendpoint in your unit test

@EndpointInject(uri=“mock:jdbc:blah”)
private MockEndpoint jdbcEndpoint;

Basically the string you pass to the annotation above is in the same format as 
the uri up to the question mark and prefixed with “mock:”

If you enable INFO level logging on  
org.apache.camel.impl.InterceptSendToMockEndpointStrategy, then on successful 
mocking, you’ll see something like the following in the logs (this is an 
example in my project)

2016-09-27 08:56:03,195 [main] INFO  
org.apache.camel.impl.InterceptSendToMockEndpointStrategy - Adviced endpoint 
[activemq://sms_queue.qDLQ?cacheLevelName=CACHE_CONSUMER&jmsMessageType=Text&lazyCreateTransactionManager=false&messageConverter=%23messageConverter&transacted=true]
 with mock endpoint [mock:activemq:sms_queue.qDLQ]


> On 27 Sep 2016, at 12:37 AM, dermoritz <tantea...@hotmail.com> wrote:
> 
> I have a route that end on a jdbc endpoint:
> 
> 
> 
> The  jdbc Endpoint is created this way:
> 
> 
> 
> In my unit test i want "mock and skip" the database:
> 
> 
> 
> I also tried other patterns: "jdbc:db", "jdbc://db" (this string is shown in
> log and is the output of toString)
> 
> But no matter what pattern used the database is called. Log shows
> 
> 
> 
> And the correct (empty) result is sent to mock endpoint at the end. And the
> mocked endpint ``mock:jdbc:db`` or ``mock:jdbc://db`` () never receives
> anything.
> 
> So how to skip this jdbc endpoint?
> 
> And how to get a reference to mock endpoints that are created with wildcards
> like '*'?
> 
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-isMockEndpointsAndSkip-doesn-t-skip-jdbc-endpoint-tp5788065.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to