JUnit Test, autowired membervariable null but context has been initialized

Hi,

In my project I using libraries which implements client webservices. The libraries are build with Spring-ws and can be called using profiles to connect to a mock of the referenced webservice. I have 2 service tasks which are using one of the referenced webservice clients. When I deploy the project on my Tomcat server, the process is working and the mocked webservices are invoked properly.

I want to be able to JUnit test this process and use the mocked webservices. I created a spring config which setup the needed context. Both of the Webservices are beeing intialized properly. This is done before final JUnittest is invoked.

When the junittest gets invoked “I have a break point on the given service tasks” the autowired membervariable pointing to the webservices is “null”.

In other words it looks if the spring context isn’t propagated into service task?
I using a spring config and a separated camunda config.
Is there an example around or does someone have advise?

Cheers Dirk

I introduced a separate spring context an was able to wire the membervariables.