From bde7cf539b9e74121ee0ab312a6ce1a8fa20fae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Burzy=C5=84ski?= Date: Mon, 21 Oct 2024 10:15:28 +0200 Subject: [PATCH] address review comment --- .../konnect_entities_kongvault_test.go | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/test/envtest/konnect_entities_kongvault_test.go b/test/envtest/konnect_entities_kongvault_test.go index 43ee412ef..14d726ed5 100644 --- a/test/envtest/konnect_entities_kongvault_test.go +++ b/test/envtest/konnect_entities_kongvault_test.go @@ -135,11 +135,23 @@ func TestKongVault(t *testing.T) { t.Log("Setting up mock SDK for vault creation with conflict") sdk.VaultSDK.EXPECT().CreateVault(mock.Anything, cp.GetKonnectStatus().GetKonnectID(), mock.MatchedBy(func(input sdkkonnectcomp.VaultInput) bool { return input.Name == vaultBackend && input.Prefix == vaultPrefix - })).Return(&sdkkonnectops.CreateVaultResponse{ - Vault: &sdkkonnectcomp.Vault{ - ID: lo.ToPtr(vaultID), - }, - }, &sdkkonnecterrs.ConflictError{}) + })).Return(nil, &sdkkonnecterrs.SDKError{ + StatusCode: 400, + Body: `{ + "code": 3, + "message": "data constraint error", + "details": [ + { + "@type": "type.googleapis.com/kong.admin.model.v1.ErrorDetail", + "type": "ERROR_TYPE_REFERENCE", + "field": "name", + "messages": [ + "name (type: unique) constraint failed" + ] + } + ] + }`, + }) sdk.VaultSDK.EXPECT().ListVault( mock.Anything,