You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ephemeris Lappis <ep...@gmail.com> on 2023/01/27 11:57:00 UTC

CamelBlueprintTestSupport : best way to add beans to CamelContext

Hello.

In our unit tests we use CamelBlueprintTestSupport. Almost all the
objects our routes depend on are OSGi services that are provided on
"addServicesOnStartup", either with real classes, or mocks (Mockito).

Only for the unit test I need to add a simple bean (in fact, an
EventNotifier) to help tracking and checking the exact path of
exchanges on asynchronous routes. I've added it as a service, and it
seems to work. Well !

Is there a better place to add beans to the CamelContext. It seems
that adding the bean in "doPostSetUp" is too late, and the Camel
context doesn't take my event notifier into account...

Thanks for your help.

Regards.