forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_proxy_reader.go
151 lines (135 loc) · 3.74 KB
/
fake_proxy_reader.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// Code generated by counterfeiter. DO NOT EDIT.
package pluginfakes
import (
"io"
"sync"
"code.cloudfoundry.org/cli/api/plugin"
)
type FakeProxyReader struct {
WrapStub func(io.Reader) io.ReadCloser
wrapMutex sync.RWMutex
wrapArgsForCall []struct {
arg1 io.Reader
}
wrapReturns struct {
result1 io.ReadCloser
}
wrapReturnsOnCall map[int]struct {
result1 io.ReadCloser
}
StartStub func(int64)
startMutex sync.RWMutex
startArgsForCall []struct {
arg1 int64
}
FinishStub func()
finishMutex sync.RWMutex
finishArgsForCall []struct{}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeProxyReader) Wrap(arg1 io.Reader) io.ReadCloser {
fake.wrapMutex.Lock()
ret, specificReturn := fake.wrapReturnsOnCall[len(fake.wrapArgsForCall)]
fake.wrapArgsForCall = append(fake.wrapArgsForCall, struct {
arg1 io.Reader
}{arg1})
fake.recordInvocation("Wrap", []interface{}{arg1})
fake.wrapMutex.Unlock()
if fake.WrapStub != nil {
return fake.WrapStub(arg1)
}
if specificReturn {
return ret.result1
}
return fake.wrapReturns.result1
}
func (fake *FakeProxyReader) WrapCallCount() int {
fake.wrapMutex.RLock()
defer fake.wrapMutex.RUnlock()
return len(fake.wrapArgsForCall)
}
func (fake *FakeProxyReader) WrapArgsForCall(i int) io.Reader {
fake.wrapMutex.RLock()
defer fake.wrapMutex.RUnlock()
return fake.wrapArgsForCall[i].arg1
}
func (fake *FakeProxyReader) WrapReturns(result1 io.ReadCloser) {
fake.WrapStub = nil
fake.wrapReturns = struct {
result1 io.ReadCloser
}{result1}
}
func (fake *FakeProxyReader) WrapReturnsOnCall(i int, result1 io.ReadCloser) {
fake.WrapStub = nil
if fake.wrapReturnsOnCall == nil {
fake.wrapReturnsOnCall = make(map[int]struct {
result1 io.ReadCloser
})
}
fake.wrapReturnsOnCall[i] = struct {
result1 io.ReadCloser
}{result1}
}
func (fake *FakeProxyReader) Start(arg1 int64) {
fake.startMutex.Lock()
fake.startArgsForCall = append(fake.startArgsForCall, struct {
arg1 int64
}{arg1})
fake.recordInvocation("Start", []interface{}{arg1})
fake.startMutex.Unlock()
if fake.StartStub != nil {
fake.StartStub(arg1)
}
}
func (fake *FakeProxyReader) StartCallCount() int {
fake.startMutex.RLock()
defer fake.startMutex.RUnlock()
return len(fake.startArgsForCall)
}
func (fake *FakeProxyReader) StartArgsForCall(i int) int64 {
fake.startMutex.RLock()
defer fake.startMutex.RUnlock()
return fake.startArgsForCall[i].arg1
}
func (fake *FakeProxyReader) Finish() {
fake.finishMutex.Lock()
fake.finishArgsForCall = append(fake.finishArgsForCall, struct{}{})
fake.recordInvocation("Finish", []interface{}{})
fake.finishMutex.Unlock()
if fake.FinishStub != nil {
fake.FinishStub()
}
}
func (fake *FakeProxyReader) FinishCallCount() int {
fake.finishMutex.RLock()
defer fake.finishMutex.RUnlock()
return len(fake.finishArgsForCall)
}
func (fake *FakeProxyReader) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.wrapMutex.RLock()
defer fake.wrapMutex.RUnlock()
fake.startMutex.RLock()
defer fake.startMutex.RUnlock()
fake.finishMutex.RLock()
defer fake.finishMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeProxyReader) 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 _ plugin.ProxyReader = new(FakeProxyReader)