We had an issue with our spring beans not being autowired in our unit tests.Our activiti.cfg.xml file contains <context:annotation-config/>
We call a JavaDelegate class using activiti:delegateExpression <serviceTask id="checkValidName" name="CheckValidName" activiti:delegateExpression="${nameChecker}"></serviceTask>
The cause of the problem is ActivitiRule who delegates to org.activiti.engine.impl.cfg.BeansConfigurationHelper:
arseProcessEngineConfiguration to instantiate the spring context using DefaultListableBeanFactory. Because no ApplicationContext is used, the <context:annotation-config/>
seems to be ignored. (BeanFactory only supports the older Autowire collaborators mechanism. http://static.springsource.org/spring/docs/3.0.0.RELEASE/reference/htmlsingle/#beans-factory-autowir...)If we instantiate the Spring context ourselves in the unit test using ClassPathXmlApplicationContext, we have no issues with autowiring.Is it possible to review the implementation of BeansConfigurationHelper to use an application context instead of beanFactory?