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
...
.withStateChangeFunction({
case ProviderState("a user exists", params) =>
val id = params.getOrElse("id", fail("params missing value id"))
createUserWithId(id)
case _ => ()
}: PartialFunction[ProviderState, Unit])
Expected
Pact verification calls producer with path /api/users/6000
Actual
Pact verification calls producer with path /api/users/
Need help regarding the above scenario. I am not sure if it's a bug, yet to be supported feature or if I am doing something wrong.
[PACT4S TEST INFO] Request to mock provider server with port 49171 in test suite scalatest/requestresponse/PactVerifierStateChangeFunctionSuite.scala
[PACT4S TEST INFO] Request(method=GET, uri=/anyone-, headers=Headers(Accept-Encoding: gzip, x-gzip, deflate, Host: localhost:49171, Connection: keep-alive, User-Agent: Apache-HttpClient/5.1.1 (Java/11.0.11)))
[PACT4S TEST INFO] Response(status=404, headers=Headers(Content-Type: text/plain; charset=UTF-8, Content-Length: 9))
[PACT4S TEST INFO] Duration: 0 millis
2022-05-19 01:44:07,378 [pool-2-thread-1] DEBUG a.c.d.pact.provider.ProviderClient - Received response: 404
2022-05-19 01:44:07,379 [pool-2-thread-1] DEBUG a.c.d.pact.provider.ProviderClient - Response: ProviderResponse(statusCode=404, headers={Date=[Thu, 19 May 2022 00:44:07 GMT], Connection=[keep-alive], Content-Type=[text/plain; charset=UTF-8], Content-Length=[9]}, contentType=text/plain; charset=UTF-8, body=Not found)
returns a response which
has status code 200 (FAILED)
has a matching body (FAILED)
The text was updated successfully, but these errors were encountered:
Consumer pact using pathFromProviderState (see section "Having values injected from provider state callbacks
" on pact-jvm consumer docs)
creates a pact json file with interaction object like
Producer verification state change function
Expected
Pact verification calls producer with path
/api/users/6000
Actual
Pact verification calls producer with path
/api/users/
Need help regarding the above scenario. I am not sure if it's a bug, yet to be supported feature or if I am doing something wrong.
I have been able to replicate this on the PactVerifierStateChangeFunctionSuite.scala test by using the following pact json content modified to use generators
Logs from unit test execution
The text was updated successfully, but these errors were encountered: