-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_state_store.go
129 lines (115 loc) · 3.42 KB
/
fake_state_store.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
// Code generated by counterfeiter. DO NOT EDIT.
package rundmcfakes
import (
"sync"
"code.cloudfoundry.org/guardian/rundmc"
)
type FakeStateStore struct {
StoreStoppedStub func(handle string)
storeStoppedMutex sync.RWMutex
storeStoppedArgsForCall []struct {
handle string
}
IsStoppedStub func(handle string) bool
isStoppedMutex sync.RWMutex
isStoppedArgsForCall []struct {
handle string
}
isStoppedReturns struct {
result1 bool
}
isStoppedReturnsOnCall map[int]struct {
result1 bool
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeStateStore) StoreStopped(handle string) {
fake.storeStoppedMutex.Lock()
fake.storeStoppedArgsForCall = append(fake.storeStoppedArgsForCall, struct {
handle string
}{handle})
fake.recordInvocation("StoreStopped", []interface{}{handle})
fake.storeStoppedMutex.Unlock()
if fake.StoreStoppedStub != nil {
fake.StoreStoppedStub(handle)
}
}
func (fake *FakeStateStore) StoreStoppedCallCount() int {
fake.storeStoppedMutex.RLock()
defer fake.storeStoppedMutex.RUnlock()
return len(fake.storeStoppedArgsForCall)
}
func (fake *FakeStateStore) StoreStoppedArgsForCall(i int) string {
fake.storeStoppedMutex.RLock()
defer fake.storeStoppedMutex.RUnlock()
return fake.storeStoppedArgsForCall[i].handle
}
func (fake *FakeStateStore) IsStopped(handle string) bool {
fake.isStoppedMutex.Lock()
ret, specificReturn := fake.isStoppedReturnsOnCall[len(fake.isStoppedArgsForCall)]
fake.isStoppedArgsForCall = append(fake.isStoppedArgsForCall, struct {
handle string
}{handle})
fake.recordInvocation("IsStopped", []interface{}{handle})
fake.isStoppedMutex.Unlock()
if fake.IsStoppedStub != nil {
return fake.IsStoppedStub(handle)
}
if specificReturn {
return ret.result1
}
return fake.isStoppedReturns.result1
}
func (fake *FakeStateStore) IsStoppedCallCount() int {
fake.isStoppedMutex.RLock()
defer fake.isStoppedMutex.RUnlock()
return len(fake.isStoppedArgsForCall)
}
func (fake *FakeStateStore) IsStoppedArgsForCall(i int) string {
fake.isStoppedMutex.RLock()
defer fake.isStoppedMutex.RUnlock()
return fake.isStoppedArgsForCall[i].handle
}
func (fake *FakeStateStore) IsStoppedReturns(result1 bool) {
fake.IsStoppedStub = nil
fake.isStoppedReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeStateStore) IsStoppedReturnsOnCall(i int, result1 bool) {
fake.IsStoppedStub = nil
if fake.isStoppedReturnsOnCall == nil {
fake.isStoppedReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isStoppedReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeStateStore) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.storeStoppedMutex.RLock()
defer fake.storeStoppedMutex.RUnlock()
fake.isStoppedMutex.RLock()
defer fake.isStoppedMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeStateStore) 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 _ rundmc.StateStore = new(FakeStateStore)