I just clone master on example-provider-java-kafka...
# pactflow
a
I just clone master on example-provider-java-kafka.git and run ./gradlew clean test which fails with errors below. Any advice? Thanks.
Starting process 'Gradle Test Executor 5'. Working directory: /ws/vuongan/pacts/example-provider-java-kafka Command: /ws/vuongan/jdk-17.0.4/bin/java -Dorg.gradle.internal.worker.tmpdir=/ws/vuongan/pacts/example-provider-java-kafka/build/tmp/test/work -Dorg.gradle.native=false @/ws/vuongan/dev/.gradle/.tmp/gradle-worker-classpath2637501272871811105txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -ea <http://worker.org|worker.org>.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 5'
Successfully started process 'Gradle Test Executor 5' ProductsKafkaProducerTest > testTemplate(Pact, Interaction, PactVerificationContext) > io.pactflow.example.kafka.ProductsKafkaProducerTest.initializationError FAILED org.junit.platform.commons.PreconditionViolationException: You must register at least one TestTemplateInvocationContextProvider that supports @TestTemplate method [void io.pactflow.example.kafka.ProductsKafkaProducerTest.testTemplate(au.com.dius.pact.core.model.Pact,au.com.dius.pact.core.model.Interaction,au.com.dius.pact.provider.junit5.PactVerificationContext)] at app//org.junit.platform.commons.util.Preconditions.condition(Preconditions.java:296)
u
That example must be broken. What version of Java are you using?
oh, 17
You might need to run it with Java 11
a
I successfully run example-consumer-java-kafka with jdk 17 and build.gradle: plugins { id 'org.springframework.boot' version '2.7.3' id "au.com.dius.pact" version "4.2.0" id "io.freefair.lombok" version "6.5.1" } apply plugin: 'java' apply plugin: 'io.spring.dependency-management' group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = '17' then try jdk 17 on provider. I need to use jdk 17. Any suggestion that I can try with 17?
u
🤷‍♂️ looks like that example is not working. Try upgrade the Pact version to the latest
a
Tried with 4.3.14 and same failure:
> Task :clean
> Task :processResources
> Task :processTestResources
> Task :generateEffectiveLombokConfig
> Task :compileJava
> Task :classes
> Task :generateTestEffectiveLombokConfig
> Task :compileTestJava
> Task :testClasses
> Task :test FAILED
ProductsKafkaProducerTest > testTemplate(Pact, Interaction, PactVerificationContext) > io.pactflow.example.kafka.ProductsKafkaProducerTest.initializationError FAILED
org.junit.platform.commons.PreconditionViolationException at Preconditions.java:296
1 test completed, 1 failed