-
Notifications
You must be signed in to change notification settings - Fork 5
/
mock_vaultclient.go
52 lines (43 loc) · 1.23 KB
/
mock_vaultclient.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Copyright (c) 2024 Intel Corporation
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
package vaultclient
import (
"github.com/stretchr/testify/mock"
"intel/kbs/v1/model"
)
// MockVaultClient is a mock of VaultClient interface
type MockVaultClient struct {
mock.Mock
}
// NewMockVaultClient creates a new mock instance
func NewMockVaultClient() *MockVaultClient {
return &MockVaultClient{}
}
// InitializeClient mocks base method
func (m *MockVaultClient) InitializeClient(serverIP, serverPort, clientToken string) error {
args := m.Called(serverIP, serverPort, clientToken)
return args.Error(0)
}
// CreateKey mocks base method
func (m *MockVaultClient) CreateKey(keyAttrib *model.KeyAttributes) error {
args := m.Called(keyAttrib)
return args.Error(0)
}
// DeleteKey mocks base method
func (m *MockVaultClient) DeleteKey(id string) error {
args := m.Called(id)
return args.Error(0)
}
// GetKey mocks base method
func (m *MockVaultClient) GetKey(id string) ([]byte, error) {
args := m.Called(id)
return args.Get(0).([]byte), args.Error(1)
}
// ListKeys mocks base method
func (m *MockVaultClient) ListKeys() ([]interface{}, error) {
args := m.Called()
return args.Get(0).([]interface{}), args.Error(1)
}