Hello guys, i am getting this error when i try to ...
# pact-jvm
t
Hello guys, i am getting this error when i try to run pact provider verification with @WebMvcTest
Copy code
12:44:25.963 [main] WARN au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader - Failed to instantiate the value resolver, using the default
java.lang.IllegalAccessException: class au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader cannot access a member of class au.com.dius.pact.core.support.expressions.SystemPropertyResolver with modifiers "private"
   at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
   at java.base/jdk.internal.reflect.Reflection.ensureMemberAccess(Reflection.java:99)
   at java.base/java.lang.Class.newInstance(Class.java:579)
   at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.setupValueResolver(PactBrokerLoader.kt:168)
   at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.load(PactBrokerLoader.kt:99)
   at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider$resolvePactSources$$inlined$flatMap$lambda$1.invoke(PactJUnit5VerificationProvider.kt:80)
   at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider$resolvePactSources$$inlined$flatMap$lambda$1.invoke(PactJUnit5VerificationProvider.kt:37)
   at au.com.dius.pact.core.support.KotlinLanguageSupportKt.handleWith(KotlinLanguageSupport.kt:38)
   at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider.resolvePactSources(PactJUnit5VerificationProvider.kt:80)
   at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider.provideTestTemplateInvocationContexts(PactJUnit5VerificationProvider.kt:41)
   at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.lambda$execute$0(TestTemplateTestDescriptor.java:102)
i am not sure what cause this but if i replace @WebMvcTest with @SpringBootTest then i dont get this error, however it requires other external components running (mysql, message broker,...) since the whole spring context is loaded
u
Make sure you are not mixing different Pact-JVM library versions, they should ideally all be the same version