We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
pact_ffi
0.4.25
v3
v4
bool pactffi_with_query_parameter_v2( InteractionHandle interaction, const char *name, size_t index, const char *value );
Setting up unit tests for PactSwift verifying various query parameter usage for Include matcher type.
PactSwift
Include
QueryMismatch: Unable to match ["sub"] using Include("sub") Expected: ["sub"] Actual: ["substring"] Parameter: $.item])"
Steps to reproduce the behaviour:
"{\"pact:matcher:type\":\"include\",\"value\":\"sub\"}"
GET /endpoint?item=substring
Pact test should succeed when GET request’s query parameters’ value contains the substring defined in Include matcher.
GET
Pact test fails stating:
... RefCell { value: PactHandleInner { pact: V4Pact { consumer: Consumer { name: "Consumer" }, provider: Provider { name: "Provider" }, interactions: [ SynchronousHttp { id: None, key: None, description: "an interaction with query item matcher 'includes'", provider_states: [], request: HttpRequest { method: "GET", path: "/interaction", query: Some({"item": [Some("sub")]}), headers: None, body: Missing, matching_rules: MatchingRules { rules: { PATH: MatchingRuleCategory { name: PATH, rules: {} }, QUERY: MatchingRuleCategory { name: QUERY, rules: { DocPath { path_tokens: [Root, Field("item")], expr: "$.item" }: RuleList { rules: [Include("sub")], rule_logic: And, cascaded: false } } } } }, generators: Generators { categories: {} } }, response: HttpResponse { status: 200, headers: None, body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, comments: {}, pending: false, plugin_config: {}, interaction_markup: InteractionMarkup { markup: "", markup_type: "" }, transport: None } ], metadata: { "namespace1": Object {"name1": String("value1")}, "namespace2": Object {"name2": String("value2")}, "pactRust": Object {"ffi": String("0.4.25")} }, plugin_data: [] }, mock_server_started: true, specification_version: V4 } } ... ---------------------------------------------------------------------------------------- method: GET path: /interaction query: Some({"item": [Some("substring")]}) headers: Some({"accept-language": ["en-AU", "en;q=0.9"], "user-agent": ["xctest/23600 CFNetwork/1568.300.101 Darwin/24.2.0"], "host": ["127.0.0.1:4658"], "accept-encoding": ["gzip", "deflate"], "connection": ["keep-alive"], "accept": ["*/*"]}) body: Empty ---------------------------------------------------------------------------------------- ... QueryMismatch: Unable to match ["sub"] using Include("sub") Expected: ["sub"] Actual: ["substring"] Parameter: $.item])" ...
See attached query-param-include-matcher-issue.log for full standardOut: .trace log:
query-param-include-matcher-issue.log
standardOut: .trace
The text was updated successfully, but these errors were encountered:
fix: Do not apply include matcher at the collection level #485
e98a218
No branches or pull requests
🌎 Environment
pact_ffi
0.4.25
v3
,v4
💬 Description
Setting up unit tests for
PactSwift
verifying various query parameter usage forInclude
matcher type.🦶 Reproduction Steps
Steps to reproduce the behaviour:
"{\"pact:matcher:type\":\"include\",\"value\":\"sub\"}"
GET /endpoint?item=substring
,🤔 Expected Results
Pact test should succeed when
GET
request’s query parameters’ value contains the substring defined inInclude
matcher.😲 Actual Results
Pact test fails stating:
🌳 Logs
📄 Stack Traces
See attached
query-param-include-matcher-issue.log
for fullstandardOut: .trace
log:query-param-include-matcher-issue.log
🤝 Relationships
The text was updated successfully, but these errors were encountered: