Skip to content

Commit

Permalink
tests: fix mock matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Feb 7, 2025
1 parent b8511b2 commit 380ee46
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/envtest/konnect_entities_kongconsumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,13 @@ func TestKongConsumerSecretCredentials(t *testing.T) {
sdk.KongCredentialsBasicAuthSDK.EXPECT().
CreateBasicAuthWithConsumer(
mock.Anything,
mock.Anything,
// mock.MatchedBy(
// func(r sdkkonnectops.CreateBasicAuthWithConsumerRequest) bool {
// return r.ControlPlaneID == cp.GetKonnectID() &&
// r.BasicAuthWithoutParents.Username == username &&
// r.BasicAuthWithoutParents.Password == "password"
// },
// ),
mock.MatchedBy(
func(r sdkkonnectops.CreateBasicAuthWithConsumerRequest) bool {
return r.ControlPlaneID == cp.GetKonnectID() &&
r.BasicAuthWithoutParents.Username == username &&
r.BasicAuthWithoutParents.Password == "password"
},
),
).
Return(
&sdkkonnectops.CreateBasicAuthWithConsumerResponse{
Expand Down

0 comments on commit 380ee46

Please sign in to comment.