https://pact.io logo
#pact-jvm
Title
# pact-jvm
a

Anh Vuong

09/22/2022, 6:22 PM
I have almost same contract tests - same class name, imports, provider, consumer names etc - and "mvn test" works in one simpler repo and fails on a bigger repo with errors below. I have compared pom.xml for libraries's versions, jdk 17 etc. I run out of clues. Hope some one ahs seen the errors. java.lang.IncompatibleClassChangeError: Expected static method 'java.lang.Object au.com.dius.pact.core.support.expressions.ExpressionParser.parseExpression(java.lang.String, au.com.dius.pact.core.support.expressions.DataType)' at au.com.dius.pact.consumer.junit.MessagePactProviderRule.parsePacts(MessagePactProviderRule.java:192) at au.com.dius.pact.consumer.junit.MessagePactProviderRule$1.evaluate(MessagePactProviderRule.java:96) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) Process finished with exit code 255 import au.com.dius.pact.consumer.MessagePactBuilder; import au.com.dius.pact.consumer.dsl.DslPart; import au.com.dius.pact.consumer.dsl.PactDslJsonBody; import au.com.dius.pact.consumer.junit.MessagePactProviderRule; import au.com.dius.pact.consumer.junit.PactVerification; import au.com.dius.pact.core.model.annotations.Pact; import au.com.dius.pact.core.model.messaging.MessagePact; import com.google.protobuf.TextFormat; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.Map; public class ApStateConsumerMessagePactTest { @Rule public MessagePactProviderRule mockProvider = new MessagePactProviderRule("producer-message", this); ... }
u

uglyog

09/26/2022, 1:19 AM
This means you have a mismatch in the versions of the Pact-JVM libraries. You need to make sure all the Pact-JVM libraries you use have the same major and minor versions.