forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_generator.go
119 lines (105 loc) · 3.2 KB
/
fake_generator.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
// This file was generated by counterfeiter
package releasedirfakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/releasedir"
)
type FakeGenerator struct {
GenerateJobStub func(string) error
generateJobMutex sync.RWMutex
generateJobArgsForCall []struct {
arg1 string
}
generateJobReturns struct {
result1 error
}
GeneratePackageStub func(string) error
generatePackageMutex sync.RWMutex
generatePackageArgsForCall []struct {
arg1 string
}
generatePackageReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeGenerator) GenerateJob(arg1 string) error {
fake.generateJobMutex.Lock()
fake.generateJobArgsForCall = append(fake.generateJobArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("GenerateJob", []interface{}{arg1})
fake.generateJobMutex.Unlock()
if fake.GenerateJobStub != nil {
return fake.GenerateJobStub(arg1)
} else {
return fake.generateJobReturns.result1
}
}
func (fake *FakeGenerator) GenerateJobCallCount() int {
fake.generateJobMutex.RLock()
defer fake.generateJobMutex.RUnlock()
return len(fake.generateJobArgsForCall)
}
func (fake *FakeGenerator) GenerateJobArgsForCall(i int) string {
fake.generateJobMutex.RLock()
defer fake.generateJobMutex.RUnlock()
return fake.generateJobArgsForCall[i].arg1
}
func (fake *FakeGenerator) GenerateJobReturns(result1 error) {
fake.GenerateJobStub = nil
fake.generateJobReturns = struct {
result1 error
}{result1}
}
func (fake *FakeGenerator) GeneratePackage(arg1 string) error {
fake.generatePackageMutex.Lock()
fake.generatePackageArgsForCall = append(fake.generatePackageArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("GeneratePackage", []interface{}{arg1})
fake.generatePackageMutex.Unlock()
if fake.GeneratePackageStub != nil {
return fake.GeneratePackageStub(arg1)
} else {
return fake.generatePackageReturns.result1
}
}
func (fake *FakeGenerator) GeneratePackageCallCount() int {
fake.generatePackageMutex.RLock()
defer fake.generatePackageMutex.RUnlock()
return len(fake.generatePackageArgsForCall)
}
func (fake *FakeGenerator) GeneratePackageArgsForCall(i int) string {
fake.generatePackageMutex.RLock()
defer fake.generatePackageMutex.RUnlock()
return fake.generatePackageArgsForCall[i].arg1
}
func (fake *FakeGenerator) GeneratePackageReturns(result1 error) {
fake.GeneratePackageStub = nil
fake.generatePackageReturns = struct {
result1 error
}{result1}
}
func (fake *FakeGenerator) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.generateJobMutex.RLock()
defer fake.generateJobMutex.RUnlock()
fake.generatePackageMutex.RLock()
defer fake.generatePackageMutex.RUnlock()
return fake.invocations
}
func (fake *FakeGenerator) 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.Generator = new(FakeGenerator)