-
Notifications
You must be signed in to change notification settings - Fork 152
/
fake_flux.go
121 lines (109 loc) · 3.54 KB
/
fake_flux.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// Code generated by counterfeiter. DO NOT EDIT.
package fluxfakes
import (
"sync"
"github.com/weaveworks/weave-gitops/pkg/flux"
"github.com/weaveworks/weave-gitops/pkg/gitproviders"
)
type FakeFlux struct {
CreateSecretGitStub func(string, gitproviders.RepoURL, string) ([]byte, error)
createSecretGitMutex sync.RWMutex
createSecretGitArgsForCall []struct {
arg1 string
arg2 gitproviders.RepoURL
arg3 string
}
createSecretGitReturns struct {
result1 []byte
result2 error
}
createSecretGitReturnsOnCall map[int]struct {
result1 []byte
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeFlux) CreateSecretGit(arg1 string, arg2 gitproviders.RepoURL, arg3 string) ([]byte, error) {
fake.createSecretGitMutex.Lock()
ret, specificReturn := fake.createSecretGitReturnsOnCall[len(fake.createSecretGitArgsForCall)]
fake.createSecretGitArgsForCall = append(fake.createSecretGitArgsForCall, struct {
arg1 string
arg2 gitproviders.RepoURL
arg3 string
}{arg1, arg2, arg3})
stub := fake.CreateSecretGitStub
fakeReturns := fake.createSecretGitReturns
fake.recordInvocation("CreateSecretGit", []interface{}{arg1, arg2, arg3})
fake.createSecretGitMutex.Unlock()
if stub != nil {
return stub(arg1, arg2, arg3)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeFlux) CreateSecretGitCallCount() int {
fake.createSecretGitMutex.RLock()
defer fake.createSecretGitMutex.RUnlock()
return len(fake.createSecretGitArgsForCall)
}
func (fake *FakeFlux) CreateSecretGitCalls(stub func(string, gitproviders.RepoURL, string) ([]byte, error)) {
fake.createSecretGitMutex.Lock()
defer fake.createSecretGitMutex.Unlock()
fake.CreateSecretGitStub = stub
}
func (fake *FakeFlux) CreateSecretGitArgsForCall(i int) (string, gitproviders.RepoURL, string) {
fake.createSecretGitMutex.RLock()
defer fake.createSecretGitMutex.RUnlock()
argsForCall := fake.createSecretGitArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}
func (fake *FakeFlux) CreateSecretGitReturns(result1 []byte, result2 error) {
fake.createSecretGitMutex.Lock()
defer fake.createSecretGitMutex.Unlock()
fake.CreateSecretGitStub = nil
fake.createSecretGitReturns = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *FakeFlux) CreateSecretGitReturnsOnCall(i int, result1 []byte, result2 error) {
fake.createSecretGitMutex.Lock()
defer fake.createSecretGitMutex.Unlock()
fake.CreateSecretGitStub = nil
if fake.createSecretGitReturnsOnCall == nil {
fake.createSecretGitReturnsOnCall = make(map[int]struct {
result1 []byte
result2 error
})
}
fake.createSecretGitReturnsOnCall[i] = struct {
result1 []byte
result2 error
}{result1, result2}
}
func (fake *FakeFlux) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.createSecretGitMutex.RLock()
defer fake.createSecretGitMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeFlux) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ flux.Flux = new(FakeFlux)