Skip to content

Commit

Permalink
address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Oct 21, 2024
1 parent b8e26f6 commit bde7cf5
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions test/envtest/konnect_entities_kongvault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bde7cf5

Please sign in to comment.