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
The inexact machers (e.g. regex, like, etc) should allow inexact matches. For example,
Header("Authorization", Like("Bearer 1234"))
should accept "Bearer 4321".
Actual behaviour
Fails when inexact:
consumer_v2_test.go:106:
Pact Verification Failed for: TestConsumerV2_Match
Diff:
2023/03/10 16:16:52 [INFO] pact validation failed, errors:
Mismatch with header 'Authorization': Expected 'Bearer 1234' to be equal to 'Bearer 4321'
: expected: Bearer 1234
actual: Bearer 4321
and v3:
consumer_v3_test.go:86:
Pact Verification Failed for: TestConsumerV3
Diff:
2023/03/10 16:16:52 [INFO] pact validation failed, errors:
Mismatch with header 'Authorization': Expected 'Bearer 1234' to be equal to 'Bearer 4321'
: expected: Bearer 1234
actual: Bearer 4321
Steps to reproduce
Update sample test code to pass a non-exact match:
$ git diff
diff --git a/examples/consumer_v2_test.go b/examples/consumer_v2_test.go
index b800920..b569940 100644
--- a/examples/consumer_v2_test.go
+++ b/examples/consumer_v2_test.go
@@ -196,7 +193,7 @@ var rawTest = func(query string) func(config consumer.MockServerConfig) error {
// of application/json. If you don't explicitly set the content-type, you
// will get a mismatch during Verification.
req.Header.Set("Content-Type", "application/json")
- req.Header.Set("Authorization", "Bearer 1234")
+ req.Header.Set("Authorization", "Bearer 4321")
Relevent log files
Please ensure you set logging to DEBUG and attach any relevant log files here (or link from a gist).
The text was updated successfully, but these errors were encountered:
👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (PACT-1034). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps.
I have tested this with the latest version, and the tests pass. Mind checking you have the latest FFI installed (should be 0.4.3 at the time of this posting)?
Software versions
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/dev/.cache/go-build"
GOENV="/home/dev/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/dev/go/pkg/mod"
GONOPROXY="github.hpe.com"
GONOSUMDB="github.hpe.com"
GOOS="linux"
GOPATH="/home/dev/go"
GOPRIVATE="github.hpe.com"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/dev/ws/sc-authz/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4109696144=/tmp/go-build -gno-record-gcc-switches"
Expected behaviour
The inexact machers (e.g. regex, like, etc) should allow inexact matches. For example,
Header("Authorization", Like("Bearer 1234"))
should accept "Bearer 4321".
Actual behaviour
Fails when inexact:
and v3:
Steps to reproduce
Update sample test code to pass a non-exact match:
Relevent log files
Please ensure you set logging to
DEBUG
and attach any relevant log files here (or link from a gist).The text was updated successfully, but these errors were encountered: