-
Notifications
You must be signed in to change notification settings - Fork 5k
/
Broadcaster.go
66 lines (53 loc) · 1.77 KB
/
Broadcaster.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
// Code generated by mockery v2.13.1. DO NOT EDIT.
package mocks
import (
v1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
mock "github.com/stretchr/testify/mock"
)
// Broadcaster is an autogenerated mock type for the Broadcaster type
type Broadcaster struct {
mock.Mock
}
// OnAdd provides a mock function with given fields: _a0
func (_m *Broadcaster) OnAdd(_a0 interface{}) {
_m.Called(_a0)
}
// OnDelete provides a mock function with given fields: _a0
func (_m *Broadcaster) OnDelete(_a0 interface{}) {
_m.Called(_a0)
}
// OnUpdate provides a mock function with given fields: _a0, _a1
func (_m *Broadcaster) OnUpdate(_a0 interface{}, _a1 interface{}) {
_m.Called(_a0, _a1)
}
// Subscribe provides a mock function with given fields: ch, filters
func (_m *Broadcaster) Subscribe(ch chan *v1alpha1.ApplicationWatchEvent, filters ...func(*v1alpha1.ApplicationWatchEvent) bool) func() {
_va := make([]interface{}, len(filters))
for _i := range filters {
_va[_i] = filters[_i]
}
var _ca []interface{}
_ca = append(_ca, ch)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 func()
if rf, ok := ret.Get(0).(func(chan *v1alpha1.ApplicationWatchEvent, ...func(*v1alpha1.ApplicationWatchEvent) bool) func()); ok {
r0 = rf(ch, filters...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(func())
}
}
return r0
}
type mockConstructorTestingTNewBroadcaster interface {
mock.TestingT
Cleanup(func())
}
// NewBroadcaster creates a new instance of Broadcaster. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewBroadcaster(t mockConstructorTestingTNewBroadcaster) *Broadcaster {
mock := &Broadcaster{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}