Hi, Deepak.  When you say "service", are you referring to a bean that you
need to reference, by name, within the CamelContext that your route needs
to invoke a method on?  You can bind a bean to the registry of the context
before you start it.  How are you initializing the context for your tests?
If you can include your setup/initialization code, I can help you with it.

On Wed, Jun 8, 2016 at 4:51 AM, deepaktaker <[email protected]> wrote:

> Hi,
>    I have written junits which mocks the endpoints.
> but my problem is my code uses a service. so if i start the route i always
> get nullpointer exception
> because the service is not initialized.
> So my question is there a way to mock a service or add a service before a
> route starts.
>
> Regards,
>
> Deepak
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-add-Service-on-before-camel-route-start-tp5783616.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to