I have a Maven project with two modules, one for the producer and another for consumer.
Project
-- Producer module
-- Consumer module
The consumer contains a dependency to the producer stubs, i.e.
<dependency>
<groupId>com.example</groupId>
<artifactId>producer-application</artifactId>
<version>1.0.0-SNAPSHOT</version>
<classifier>stubs</classifier>
<scope>test</scope>
</dependency>
and the integration tests are configured so StubRunner
uses classpath scanning, i.e.
@AutoConfigureStubRunner(
stubsMode = StubRunnerProperties.StubsMode.CLASSPATH,
ids = "com.example:producer-application:+:8090"
)
During build, the integration tests for the consumer are executed correctly but if I try to run the tests locally with JUnit through the IDE (IntelliJ), the stubs are not found and tests fail.
Is this an issue on how the project is structured? If so, is there something I can change to have it run without changing the code?
Classpath will not work from ide cause e.g. Intellij does not add the stubs jar to the classpath. It's a known issue with the ides.