forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_token.go
99 lines (87 loc) · 2.29 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
// This file was generated by counterfeiter
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
}
ValueStub func() string
valueMutex sync.RWMutex
valueArgsForCall []struct{}
valueReturns struct {
result1 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeToken) Type() string {
fake.typeMutex.Lock()
fake.typeArgsForCall = append(fake.typeArgsForCall, struct{}{})
fake.recordInvocation("Type", []interface{}{})
fake.typeMutex.Unlock()
if fake.TypeStub != nil {
return fake.TypeStub()
} else {
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) Value() string {
fake.valueMutex.Lock()
fake.valueArgsForCall = append(fake.valueArgsForCall, struct{}{})
fake.recordInvocation("Value", []interface{}{})
fake.valueMutex.Unlock()
if fake.ValueStub != nil {
return fake.ValueStub()
} else {
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) 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()
return fake.invocations
}
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)