-
Notifications
You must be signed in to change notification settings - Fork 162
/
fake_release_index_reporter.go
72 lines (63 loc) · 2.26 KB
/
fake_release_index_reporter.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
// Code generated by counterfeiter. DO NOT EDIT.
package releasedirfakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/releasedir"
)
type FakeReleaseIndexReporter struct {
ReleaseIndexAddedStub func(name, desc string, err error)
releaseIndexAddedMutex sync.RWMutex
releaseIndexAddedArgsForCall []struct {
name string
desc string
err error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeReleaseIndexReporter) ReleaseIndexAdded(name string, desc string, err error) {
fake.releaseIndexAddedMutex.Lock()
fake.releaseIndexAddedArgsForCall = append(fake.releaseIndexAddedArgsForCall, struct {
name string
desc string
err error
}{name, desc, err})
fake.recordInvocation("ReleaseIndexAdded", []interface{}{name, desc, err})
fake.releaseIndexAddedMutex.Unlock()
if fake.ReleaseIndexAddedStub != nil {
fake.ReleaseIndexAddedStub(name, desc, err)
}
}
func (fake *FakeReleaseIndexReporter) ReleaseIndexAddedCallCount() int {
fake.releaseIndexAddedMutex.RLock()
defer fake.releaseIndexAddedMutex.RUnlock()
return len(fake.releaseIndexAddedArgsForCall)
}
func (fake *FakeReleaseIndexReporter) ReleaseIndexAddedArgsForCall(i int) (string, string, error) {
fake.releaseIndexAddedMutex.RLock()
defer fake.releaseIndexAddedMutex.RUnlock()
return fake.releaseIndexAddedArgsForCall[i].name, fake.releaseIndexAddedArgsForCall[i].desc, fake.releaseIndexAddedArgsForCall[i].err
}
func (fake *FakeReleaseIndexReporter) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.releaseIndexAddedMutex.RLock()
defer fake.releaseIndexAddedMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeReleaseIndexReporter) 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 _ releasedir.ReleaseIndexReporter = new(FakeReleaseIndexReporter)