Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/download-native-libs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

FFI_VERSION="0.4.27"
FFI_VERSION="0.5.11"
FFI_BASE_URL="https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v$FFI_VERSION"

GREEN="\e[32m"
Expand Down
15 changes: 15 additions & 0 deletions docs/upgrading-to-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,18 @@ MacOS ARM64 Full Support
------------------------

MacOS now has full x86-64 and ARM support.

HTTP Request Headers with Multiple Values
-----------------------------------------

From pact-net 5.1.0, the core library `libpact_ffi` was upgraded, which includes a rewritten mock server. This now means a request header configured as separate values can mismatch
the single comma-separated value sent by an HTTP client. Configure the expected header
as the joined value instead:

```csharp
.WithHeader("X-Request", "request1, request2")
```

This replaces separate calls such as `.WithHeader("X-Request", "request1")` and
`.WithHeader("X-Request", "request2")` when those values are sent together in one
request header.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "4.0"
Expand Down
3 changes: 1 addition & 2 deletions tests/PactNet.Tests/Drivers/FfiIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public async Task HttpInteraction_v3_CreatesPactFile()
interaction.Given("provider state");
interaction.GivenWithParam("state with param", "foo", "bar");
interaction.WithRequest("POST", "/path");
interaction.WithRequestHeader("X-Request-Header", "request1", 0);
interaction.WithRequestHeader("X-Request-Header", "request2", 1);
interaction.WithRequestHeader("X-Request-Header", "request1, request2", 0);
interaction.WithQueryParameter("param", "value", 0);
interaction.WithRequestBody("application/json", @"{""foo"":42}");

Expand Down
12 changes: 4 additions & 8 deletions tests/PactNet.Tests/PactExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ public async Task WithHttpInteractions_V2_CreatesExpectedPactFile()
builder.UponReceiving("a sample request")
.Given("a provider state")
.WithRequest(HttpMethod.Post, "/things")
.WithHeader("X-Request", "request1")
.WithHeader("X-Request", "request2")
.WithHeader("X-Request", "request1, request2")
.WithQuery("param", "value1")
.WithQuery("param", "value2")
.WithJsonBody(this.matcher)
Expand Down Expand Up @@ -119,8 +118,7 @@ public async Task WithHttpInteractions_V3_CreatesExpectedPactFile()
["baz"] = "bash"
})
.WithRequest(HttpMethod.Post, "/things")
.WithHeader("X-Request", "request1")
.WithHeader("X-Request", "request2")
.WithHeader("X-Request", "request1, request2")
.WithQuery("param", "value1")
.WithQuery("param", "value2")
.WithJsonBody(this.matcher)
Expand Down Expand Up @@ -156,8 +154,7 @@ public async Task WithHttpInteractions_V4_CreatesExpectedPactFile()
["baz"] = "bash"
})
.WithRequest(HttpMethod.Post, "/things")
.WithHeader("X-Request", "request1")
.WithHeader("X-Request", "request2")
.WithHeader("X-Request", "request1, request2")
.WithQuery("param", "value1")
.WithQuery("param", "value2")
.WithJsonBody(this.matcher)
Expand Down Expand Up @@ -247,8 +244,7 @@ public async Task CombinedHttpAndMessageInteractions_v4_CreatesExpectedPactFile(
["baz"] = "bash"
})
.WithRequest(HttpMethod.Post, "/things")
.WithHeader("X-Request", "request1")
.WithHeader("X-Request", "request2")
.WithHeader("X-Request", "request1, request2")
.WithQuery("param", "value1")
.WithQuery("param", "value2")
.WithJsonBody(this.matcher)
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v2-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v3-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v3-message-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"language": "C#"
},
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v3-message-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v3-server-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "3.0.0"
Expand Down
7 changes: 3 additions & 4 deletions tests/PactNet.Tests/data/v4-combined-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
"application/json"
],
"X-Request": [
"request1",
"request2"
"request1, request2"
]
},
"matchingRules": {
Expand Down Expand Up @@ -185,8 +184,8 @@
"language": "C#"
},
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "4.0"
Expand Down
7 changes: 3 additions & 4 deletions tests/PactNet.Tests/data/v4-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
"application/json"
],
"X-Request": [
"request1",
"request2"
"request1, request2"
]
},
"matchingRules": {
Expand Down Expand Up @@ -150,8 +149,8 @@
],
"metadata": {
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "4.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/PactNet.Tests/data/v4-message-consumer-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"language": "C#"
},
"pactRust": {
"ffi": "0.4.27",
"models": "1.2.8"
"ffi": "0.5.11",
"models": "1.3.17"
},
"pactSpecification": {
"version": "4.0"
Expand Down
Loading