Open zeldigas opened 4 years ago
I haven't been able to replicate this. My test project https://github.com/uglyog/pact-maven-amqp-test worked fine after upgrading to 3.0.0-M4.
Looking at the logs, I can see
projectClasspath = [file:/C:/Users/dpavlov/AppData/Local/Temp/surefire2807362591171876872/surefirebooter3628354656395821945.jar, file:/C:/Users/dpavlov/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar, file:/C:/Users/dpavlov/.m2/repository/net/bytebuddy/byte-buddy-agent/1.10.10/byte-buddy-agent-1.10.10.jar]
From that you can see that your test code is not available on the classpath, that is why it has not found the method. Make sure you have useSystemClassLoader enabled for Surefire plugin: https://github.com/uglyog/pact-maven-amqp-test/blob/master/provider/pom.xml#L100
@uglyog indeed I don't have this option configured and can try to do it.
Maybe it is a separate question, but still - why do it matters? Is there any option for "lightweight" approach that does not require any class path scanning? After all junit extension has access to already created instance of test class and it'd be way simpler to just call methods on it instead of any of classpath scanning
That was just how it was implemented.
After updating surefire plugin from
2.22.2
to3.0.0-M4
, pact message provider tests starts failing.Looks like it fails to find annotated method that produce example message.
Below you can find test run (obfuscated a bit) with enabled debug logs for
au.com
package. The only difference is version of surefire-plugin. Not sure if it matters, but codebase is Kotlin.2.22.2 (passes)
3.0.0-M4 (fails)