Skip to content

Commit

Permalink
test: add e2e regression for CustomProviderHeaers in httpbin test. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Aug 17, 2019
1 parent fdc6dca commit c318066
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
5 changes: 3 additions & 2 deletions examples/httpbin/httpbin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ func TestPact_GinProvider(t *testing.T) {

// Verify the Provider with local Pact Files
_, err := pact.VerifyProvider(t, types.VerifyRequest{
ProviderBaseURL: "https://httpbin.org",
PactURLs: []string{filepath.ToSlash(fmt.Sprintf("%s/consumer-httpbin.json", pactDir))},
ProviderBaseURL: "https://httpbin.org",
PactURLs: []string{filepath.ToSlash(fmt.Sprintf("%s/consumer-httpbin.json", pactDir))},
CustomProviderHeaders: []string{"Authorization: Bearer SOME_TOKEN"},
})

if err != nil {
Expand Down
18 changes: 15 additions & 3 deletions examples/pacts/consumer-httpbin.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,25 @@
}
},
{
"description": "A request to the GET 301 status service",
"description": "A GET request to the bearer service",
"request": {
"method": "GET",
"path": "/status/301"
"path": "/bearer",
"headers": {
"Authorization": "Bearer 1234"
}
},
"response": {
"status": 301
"status": 200,
"body": {
"authenticated": true,
"token": "1234"
},
"matchingRules": {
"$.body.token": {
"match": "type"
}
}
}
}
],
Expand Down

0 comments on commit c318066

Please sign in to comment.