Skip to content

Commit

Permalink
chore: update readme on injecting request objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Apr 10, 2021
1 parent 2e6ae47 commit 768e768
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions provider/junit5spring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,14 @@ class MockMvcTestTargetStandaloneMockMvcTestJava {

**Important:** Since `@WebMvcTest` starts only Spring MVC components you can't use `PactVerificationSpringProvider`
and need to fallback to `PactVerificationInvocationContextProvider`

## Modifying requests

As documented in [Pact JUnit5 module](/provider/junit5/README.md#modifying-the-requests-before-they-are-sent), you can
inject a request object to modifiy the requests made. However, depending on the Pact test target you are using,
you need to use a different class.

| Test Target | Class to use |
|-------------|--------------|
| HttpTarget, HttpsTarget, SpringBootHttpTarget | org.apache.http.HttpRequest |
| MockMvcTestTarget | MockHttpServletRequestBuilder |

0 comments on commit 768e768

Please sign in to comment.