Bas Dijkstra
08/26/2023, 7:43 AM<dependency>
<groupId>au.com.dius.pact</groupId>
<artifactId>provider</artifactId>
<version>4.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>au.com.dius.pact.provider</groupId>
<artifactId>junit5spring</artifactId>
<version>4.6.2</version>
<scope>test</scope>
</dependency>
and I'm following the example here: https://docs.pact.io/implementation_guides/jvm/provider/junit5spring
However, I'm probably missing one or more dependencies here:
@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Provider("address_provider")
@PactFolder("src/test/pacts")
public class ContractTest {
@TestTemplate
@ExtendWith(PactVerificationSpringProvider.class)
public void pactVerificationTestTemplate(PactVerificationContext context) {
context.verifyInteraction();
}
}
as it can't find the @Provider, PactVerificationSpringProvider and PactVerificationContext classes. Again, probably something pretty obvious but I've been stuck on this for a while now.
I know that page references Pact v 4.4.x so that might be the problem but I'd really like to use the latest versions.Matt (pactflow.io / pact-js / pact-go)
uglyog
Matt (pactflow.io / pact-js / pact-go)
Bas Dijkstra
08/28/2023, 6:39 AM4.4.6 and that resolves these issues.
I am running on Java 17, by the way.Bas Dijkstra
08/28/2023, 6:50 AMBas Dijkstra
08/28/2023, 6:52 AMuglyog
Bas Dijkstra
08/28/2023, 7:22 AMBas Dijkstra
08/28/2023, 7:23 AMBas Dijkstra
08/28/2023, 7:51 AM4.6.2 for all dependencies, but 4.4.6 works. Again, happy to use that, but I'm really curious to see what causes this. Would love consumer and provider sides to be on the same (latest) Pact version for the workshop.Bas Dijkstra
08/28/2023, 7:52 AMGiven Customer GET: the address ID matches an existing address
A request for address data
Exception in thread "Thread-6" java.lang.NoClassDefFoundError: org/apache/commons/codec/digest/DigestUtils
at au.com.dius.pact.core.support.Metrics.hostnameHash(Metrics.kt:152)
at au.com.dius.pact.core.support.Metrics.sendMetrics$lambda-2(Metrics.kt:106)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.digest.DigestUtils
... 3 more
returns a response which
has status code 200 (OK)
has a matching body (OK)
Not sure if that's related. I've pushed the latest code to the branch I linked to just earlier.Bas Dijkstra
08/30/2023, 9:12 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Bas Dijkstra
08/30/2023, 5:11 PMYousaf Nabi (pactflow.io)
mvn test again. Just did a mvn clean and then mvn test just incase it didn’t rebuild after changing the pomYousaf Nabi (pactflow.io)
Bas Dijkstra
08/30/2023, 5:13 PMYousaf Nabi (pactflow.io)
maven:3-eclipse-temurin-17 linux arm and amd64. I’ll just up some repros so you can have a nose tomorrow. enjoy the feet up 👍Bas Dijkstra
08/30/2023, 5:18 PMYousaf Nabi (pactflow.io)
Bas Dijkstra
08/30/2023, 5:37 PMJorge Casto Núñez de Castro Cobo
09/07/2023, 11:30 PMBas Dijkstra
09/08/2023, 5:44 AMJorge Casto Núñez de Castro Cobo
09/08/2023, 12:23 PM