/
watcher.go
99 lines (80 loc) · 2.74 KB
/
watcher.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Code generated by mockery. DO NOT EDIT.
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024 Datadog, Inc.
package mocks
import (
mock "github.com/stretchr/testify/mock"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
watch "k8s.io/apimachinery/pkg/watch"
)
// CacheWatcherMock is an autogenerated mock type for the Watcher type
type CacheWatcherMock struct {
mock.Mock
}
type CacheWatcherMock_Expecter struct {
mock *mock.Mock
}
func (_m *CacheWatcherMock) EXPECT() *CacheWatcherMock_Expecter {
return &CacheWatcherMock_Expecter{mock: &_m.Mock}
}
// Watch provides a mock function with given fields: options
func (_m *CacheWatcherMock) Watch(options v1.ListOptions) (watch.Interface, error) {
ret := _m.Called(options)
if len(ret) == 0 {
panic("no return value specified for Watch")
}
var r0 watch.Interface
var r1 error
if rf, ok := ret.Get(0).(func(v1.ListOptions) (watch.Interface, error)); ok {
return rf(options)
}
if rf, ok := ret.Get(0).(func(v1.ListOptions) watch.Interface); ok {
r0 = rf(options)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(watch.Interface)
}
}
if rf, ok := ret.Get(1).(func(v1.ListOptions) error); ok {
r1 = rf(options)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CacheWatcherMock_Watch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Watch'
type CacheWatcherMock_Watch_Call struct {
*mock.Call
}
// Watch is a helper method to define mock.On call
// - options v1.ListOptions
func (_e *CacheWatcherMock_Expecter) Watch(options interface{}) *CacheWatcherMock_Watch_Call {
return &CacheWatcherMock_Watch_Call{Call: _e.mock.On("Watch", options)}
}
func (_c *CacheWatcherMock_Watch_Call) Run(run func(options v1.ListOptions)) *CacheWatcherMock_Watch_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(v1.ListOptions))
})
return _c
}
func (_c *CacheWatcherMock_Watch_Call) Return(_a0 watch.Interface, _a1 error) *CacheWatcherMock_Watch_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *CacheWatcherMock_Watch_Call) RunAndReturn(run func(v1.ListOptions) (watch.Interface, error)) *CacheWatcherMock_Watch_Call {
_c.Call.Return(run)
return _c
}
// NewCacheWatcherMock creates a new instance of CacheWatcherMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewCacheWatcherMock(t interface {
mock.TestingT
Cleanup(func())
}) *CacheWatcherMock {
mock := &CacheWatcherMock{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}