Re: mocking future routes
As the endpoint uri is string, you can change the prefix with some kind of
If you want to use it in the test, you can simply set the prefix to be
In the production world, you can just set the prefix to be an empty string.
Blog: http://willemjiang.blogspot.com (English)
On Wed, Apr 25, 2018 at 4:20 AM, Yacov Schondorf <yacov.schondorf@xxxxxxxxx>
> So sorry for the late response; only now I was able to get back to this
> I don't see how the stub component can help me here. This is a real route I
> need to mock in a production code.
> Consider this use case:
> 1. My route (let's call it route 1) has a Jetty start endpoint, and is a
> configuration service so that an incoming call would cause a configuration
> change to the system. If the incoming call has some "flag" set to "true"
> then a new route needs to be created (route 2). Route 2 has a Kafka
> endpoint which I need to mock because the connection parameters are not
> relevant at test time.
> 2. On my test, I advise route 1, and replace the Jetty endpoint with a
> start endpoint, and send a message that should trigger creation of route 2.
> Creation of route 2 fails because of the wrong Kafka parameters.
> If I add "stub:" in route 2 ("Stub:kafka...") then in non-test time the
> route will not work.
> Any solution for this?
> 2018-02-01 18:58 GMT+02:00 Claus Ibsen <claus.ibsen@xxxxxxxxx>:
> > You can try when you create the new route, to add "stub:" as the
> > prefix for your endpoints. Then you can use the stub component to mock
> > them.
> > http://camel.apache.org/stub
> > On Wed, Jan 17, 2018 at 6:10 PM, Yacov Schondorf
> > <yacov.schondorf@xxxxxxxxx> wrote:
> > > Hi,
> > > I know how to mock/advise existing routes. But what do I do if one of
> > > routes creates new routes? For example, I can send a configuration
> > message
> > > to a configuration route which has an activeMQ From endpoint. The
> > endpoint
> > > is advised and replaced with direct:a, so I send a configuration
> > in
> > > my test. The route continues by creating a new route from
> > > activeMQ:someTopic to kafka:someTopic. This route fails to create
> > > there is no real ssl-enabled kafka and activeMQ in the test
> > Is
> > > there anything that can be done?
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> יעקב שיינדורף
> מנכ"ל ומנהל פיתוח,
> מילות מפתח לאתרים
> http://keywords-4-websites.com <http://keywords-4-websites.com/home.jsp>
> יעקב שיינדורף
> מנהל מוסיקלי StyleBrass