You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module extends the base [Pact JUnit5 module](../pact-jvm-provider-junit5). See that for more details.
4
+
5
+
For writing Spring Pact verification tests with JUnit 5, there is an JUnit 5 Invocation Context Provider that you can use with
6
+
the `@TestTemplate` annotation. This will generate a test for each interaction found for the pact files for the provider.
7
+
8
+
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
9
+
add a method annotated with `@TestTemplate` and `@ExtendWith(PactVerificationSpringProvider.class)` that
10
+
takes a `PactVerificationContext` parameter. You will need to call `verifyInteraction()` on the context parameter in
Copy file name to clipboardexpand all lines: provider/pact-jvm-provider-junit5/src/main/kotlin/au/com/dius/pact/provider/junit5/PactJUnit5VerificationProvider.kt
+9-2
Original file line number
Diff line number
Diff line change
@@ -356,7 +356,7 @@ class PactVerificationStateChangeExtension(
356
356
* Main TestTemplateInvocationContextProvider for JUnit 5 Pact verification tests. This class needs to be applied to
357
357
* a test template method on a test class annotated with a @Provider annotation.
0 commit comments