Listeners not autowiring when using ProcessEngineRule

Hello,

I have been using the org.camunda.bpm.engine.test* api for exercising my workflow. All was working well until I started adding execution and task listeners into my diagram. My tests now are raising null pointer exceptions because they can’t autowire my components.

Class header:

@SpringBootTest
public class WorkflowTest

POM:

 <dependency>
            <groupId>org.camunda.bpm.assert</groupId>
            <artifactId>camunda-bpm-assert</artifactId>
            <scope>test</scope>
  </dependency>
  <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.camunda.bpm.assert</groupId>
            <artifactId>camunda-bpm-assert</artifactId>
            <scope>test</scope>
        </dependency>

Initially I thought this was more of a spring issue, but given my integration tests exercise components that use autowiring all over the place and it only appears to happen in listeners, I’m not quite sure.

As addendum, we are using the java class mapping for our listeners vs expressions. The benefits of using expressions are well documented, but we’ve had a series of production issues with 7.15.2 and found that switching to java class mappings resolved the issue, however, this breaks the tests as all the listeners complain any autowired field is null.