0

I'm using Camel 2.14.0 with Spring 3.2.11.RELEASE and testing Camel routes using Spring DSL with a JUnit 4 class that extends CamelSpringTestSupport. My problem is that I can't find a way to add beans (mocks) to the registry. I've overridden the createJndiContext() method but it never gets called. How does one add beans to the registry when testing?

Regards, Matt

Matt
  • 526
  • 6
  • 19
  • I tend to just put a spring context xml file in src/test/resources – Ray Nov 17 '14 at 12:56
  • Does this [thread](http://stackoverflow.com/questions/2457239/injecting-mockito-mocks-into-a-spring-bean) help? I could not get [springockito](https://bitbucket.org/kubek2k/springockito/wiki/Home) to work with Camel though, because they require you to inherit from their own base class/use their JUnit runner. – Ralf Nov 17 '14 at 16:15

1 Answers1

0

Camel build the registry on top of Spring ApplicationContext, so you may need to add the mocks from the Spring configuration file or configuration class.

Willem Jiang
  • 3,291
  • 1
  • 14
  • 14