pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

Pact provider how to add request attribute #1307

Open YingzheHeBetty opened 3 years ago

YingzheHeBetty commented 3 years ago

In pact jvm provider, we have @TargetRequestFilter to add a header to the HTTP request. Is there any similar way to add a request attribute to HTTP servlet request as well?

uglyog commented 3 years ago

Pact tests the provider from the outside (by sending a HTTP request). @TargetRequestFilter works by modifying the request that is sent. A request attribute is internal to the provider.

What do you require to set? Is this not something that can be done with provider states?