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
Copy file name to clipboardexpand all lines: provider/pact-jvm-provider-junit5/README.md
+6
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,12 @@ For example, configure it by adding the following to your POM:
65
65
66
66
Provider State Methods work in the same way as with JUnit 4 tests, refer to the [Pact junit runner](../pact-jvm-provider-junit/README.md) docs.
67
67
68
+
### Using multiple classes for the state change methods
69
+
70
+
If you have a large number of state change methods, you can split things up by moving them to other classes. You will
71
+
need to specify the additional classes on the test context in a `Before` method. Do this with the `withStateHandler`
72
+
or `setStateHandlers` methods. See [StateAnnotationsOnAdditionalClassTest](pact-jvm-provider-junit5/src/test/java/au/com/dius/pact/provider/junit5/StateAnnotationsOnAdditionalClassTest.java) for an example.
73
+
68
74
## Modifying the requests before they are sent
69
75
70
76
**Important Note:** You should only use this feature for things that can not be persisted in the pact file. By modifying
Copy file name to clipboardexpand all lines: provider/pact-jvm-provider-junit5/src/main/kotlin/au/com/dius/pact/provider/junit5/PactJUnit5VerificationProvider.kt
Copy file name to clipboardexpand all lines: provider/pact-jvm-provider-junit5/src/test/groovy/au/com/dius/pact/provider/junit5/PactVerificationStateChangeExtensionSpec.groovy
+14-7
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,9 @@ class PactVerificationStateChangeExtensionSpec extends Specification {
24
24
Interaction interaction
25
25
privateTestResultAccumulator testResultAcc
26
26
RequestResponsePact pact
27
+
privatePactVerificationContext pactContext
28
+
privateExtensionContext testContext
29
+
privateExtensionContext.Store store
27
30
28
31
staticclassTestClass {
29
32
@@ -53,11 +56,20 @@ class PactVerificationStateChangeExtensionSpec extends Specification {
0 commit comments