forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_token.go
139 lines (125 loc) · 3.28 KB
/
fake_token.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
// Code generated by counterfeiter. DO NOT EDIT.
package uaafakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/uaa"
)
type FakeToken struct {
TypeStub func() string
typeMutex sync.RWMutex
typeArgsForCall []struct{}
typeReturns struct {
result1 string
}
typeReturnsOnCall map[int]struct {
result1 string
}
ValueStub func() string
valueMutex sync.RWMutex
valueArgsForCall []struct{}
valueReturns struct {
result1 string
}
valueReturnsOnCall map[int]struct {
result1 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeToken) Type() string {
fake.typeMutex.Lock()
ret, specificReturn := fake.typeReturnsOnCall[len(fake.typeArgsForCall)]
fake.typeArgsForCall = append(fake.typeArgsForCall, struct{}{})
fake.recordInvocation("Type", []interface{}{})
fake.typeMutex.Unlock()
if fake.TypeStub != nil {
return fake.TypeStub()
}
if specificReturn {
return ret.result1
}
return fake.typeReturns.result1
}
func (fake *FakeToken) TypeCallCount() int {
fake.typeMutex.RLock()
defer fake.typeMutex.RUnlock()
return len(fake.typeArgsForCall)
}
func (fake *FakeToken) TypeReturns(result1 string) {
fake.TypeStub = nil
fake.typeReturns = struct {
result1 string
}{result1}
}
func (fake *FakeToken) TypeReturnsOnCall(i int, result1 string) {
fake.TypeStub = nil
if fake.typeReturnsOnCall == nil {
fake.typeReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.typeReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeToken) Value() string {
fake.valueMutex.Lock()
ret, specificReturn := fake.valueReturnsOnCall[len(fake.valueArgsForCall)]
fake.valueArgsForCall = append(fake.valueArgsForCall, struct{}{})
fake.recordInvocation("Value", []interface{}{})
fake.valueMutex.Unlock()
if fake.ValueStub != nil {
return fake.ValueStub()
}
if specificReturn {
return ret.result1
}
return fake.valueReturns.result1
}
func (fake *FakeToken) ValueCallCount() int {
fake.valueMutex.RLock()
defer fake.valueMutex.RUnlock()
return len(fake.valueArgsForCall)
}
func (fake *FakeToken) ValueReturns(result1 string) {
fake.ValueStub = nil
fake.valueReturns = struct {
result1 string
}{result1}
}
func (fake *FakeToken) ValueReturnsOnCall(i int, result1 string) {
fake.ValueStub = nil
if fake.valueReturnsOnCall == nil {
fake.valueReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.valueReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeToken) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.typeMutex.RLock()
defer fake.typeMutex.RUnlock()
fake.valueMutex.RLock()
defer fake.valueMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeToken) 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 _ uaa.Token = new(FakeToken)