forked from sensu/sensu-go
/
mock_mutator_client.go
38 lines (31 loc) · 1.03 KB
/
mock_mutator_client.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
package testing
import (
"github.com/sensu/sensu-go/cli/client"
"github.com/sensu/sensu-go/types"
corev2 "github.com/sensu/sensu-go/api/core/v2"
)
// CreateMutator for use with mock package
func (c *MockClient) CreateMutator(m *types.Mutator) error {
args := c.Called(m)
return args.Error(0)
}
// DeleteMutator for use with mock package
func (c *MockClient) DeleteMutator(namespace, name string) error {
args := c.Called(namespace, name)
return args.Error(0)
}
// FetchMutator for use with mock package
func (c *MockClient) FetchMutator(name string) (*types.Mutator, error) {
args := c.Called(name)
return args.Get(0).(*types.Mutator), args.Error(1)
}
// UpdateMutator for use with mock package
func (c *MockClient) UpdateMutator(m *types.Mutator) error {
args := c.Called(m)
return args.Error(0)
}
// ListMutators for use with mock lib
func (c *MockClient) ListMutators(namespace string, options *client.ListOptions) ([]corev2.Mutator, error) {
args := c.Called(namespace, options)
return args.Get(0).([]corev2.Mutator), args.Error(1)
}