-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query parameters aren't failing the verify method for a consumer #40
Comments
@uglyog do you know what the behaviour is for jvm/rust? |
The rust core when utilised via FFI will fail in this scenario require 'pact/ffi'
require 'pact/ffi/logger'
require 'pact/ffi/mock_server'
require 'pact/ffi/http_consumer'
require 'pact/ffi/utils'
require 'json'
require 'httparty'
PactFfi::Logger::log_to_stdout(5);
@pact = PactFfi::HttpConsumer::new_pact("V4-consumer","V4-provider");
@interaction = PactFfi::HttpConsumer::new_interaction(@pact, "interaction for a consumer test")
PactFfi::HttpConsumer.with_specification(@pact, PactFfi::FfiSpecificationVersion['SPECIFICATION_VERSION_V2'])
@mock_server_port = PactFfi::MockServer.create_for_transport(@pact, '127.0.0.1', 0, "http", nil)
response = HTTParty.get("http://127.0.0.1:#{@mock_server_port}/?name=ron&status=good")
puts response
matched = PactFfi::MockServer::matched(@mock_server_port)
puts matched
mismatches = PactFfi::MockServer::mismatches(@mock_server_port)
puts mismatches which returns the mismatch [
{
"method": "GET",
"mismatches": [
{
"actual": "[\"good\"]",
"expected": "",
"mismatch": "Unexpected query parameter 'status' received",
"parameter": "status",
"type": "QueryMismatch"
},
{
"actual": "[\"ron\"]",
"expected": "",
"mismatch": "Unexpected query parameter 'name' received",
"parameter": "name",
"type": "QueryMismatch"
}
],
"path": "/",
"type": "request-mismatch"
}
] however the ruby core does appear to exhibit the behaviour where additional query params in the consumer request are not considered when ascertaining if a correct request as per the users expectations (not specifying query params should enforce that it only matches incoming requests which do not have query params) https://github.com/pact-foundation/pact-ruby-e2e-example/tree/pact-support-issue-40 |
Original discussion from gitter with @bethesque asking to track it here:
This is reproduced on:
To reproduce:
pact.verify()
doesn't throw an errorThe text was updated successfully, but these errors were encountered: