is not current version
Last Version 4.0.10

au.com.dius:pact-jvm-provider-junit5-spring 4.0.9

# Pact Spring/JUnit5 Support This module extends the base [Pact JUnit5 module](../pact-jvm-provider-junit5). See that for more details. For writing Spring Pact verification tests with JUnit 5, there is an JUnit 5 Invocation Context Provider that you can use with the `@TestTemplate` annotation. This will generate a test for each interaction found for the pact files for the provider. To use it, add the `@Provider` and `@ExtendWith(SpringExtension.class)` and one of the pact source annotations to your test class (as per a JUnit 5 test), then add a method annotated with `@TestTemplate` and `@ExtendWith(PactVerificationSpringProvider.class)` that takes a `PactVerificationContext` parameter. You will need to call `verifyInteraction()` on the context parameter in your test template method. For example: ```java @ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @Provider("Animal Profile Service") @PactBroker public class ContractVerificationTest { @TestTemplate @ExtendWith(PactVerificationSpringProvider.class) void pactVerificationTestTemplate(PactVerificationContext context) { context.verifyInteraction(); } } ``` You will now be able to setup all the required properties using the Spring context, e.g. creating an application YAML file in the test resources: ```yaml pactbroker: host: your.broker.host auth: username: broker-user password: broker.password ```

Categories

Categories

IDE Development Tools JUnit Unit Testing
GroupId

GroupId

au.com.dius
ArtifactId

ArtifactId

pact-jvm-provider-junit5-spring
Version

Version

4.0.9
Type

Type

jar

Download pact-jvm-provider-junit5-spring 4.0.9


<!-- https://jarcasting.com/artifacts/au.com.dius/pact-jvm-provider-junit5-spring/ -->
<dependency>
    <groupId>au.com.dius</groupId>
    <artifactId>pact-jvm-provider-junit5-spring</artifactId>
    <version>4.0.9</version>
</dependency>
// https://jarcasting.com/artifacts/au.com.dius/pact-jvm-provider-junit5-spring/
implementation 'au.com.dius:pact-jvm-provider-junit5-spring:4.0.9'
// https://jarcasting.com/artifacts/au.com.dius/pact-jvm-provider-junit5-spring/
implementation ("au.com.dius:pact-jvm-provider-junit5-spring:4.0.9")
'au.com.dius:pact-jvm-provider-junit5-spring:jar:4.0.9'
<dependency org="au.com.dius" name="pact-jvm-provider-junit5-spring" rev="4.0.9">
  <artifact name="pact-jvm-provider-junit5-spring" type="jar" />
</dependency>
@Grapes(
@Grab(group='au.com.dius', module='pact-jvm-provider-junit5-spring', version='4.0.9')
)
libraryDependencies += "au.com.dius" % "pact-jvm-provider-junit5-spring" % "4.0.9"
[au.com.dius/pact-jvm-provider-junit5-spring "4.0.9"]