/
fake_audit_logger.go
120 lines (106 loc) · 3.09 KB
/
fake_audit_logger.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
// Code generated by counterfeiter. DO NOT EDIT.
package platformfakes
import (
"sync"
"github.com/cloudfoundry/bosh-agent/platform"
)
type FakeAuditLogger struct {
DebugStub func(string)
debugMutex sync.RWMutex
debugArgsForCall []struct {
arg1 string
}
ErrStub func(string)
errMutex sync.RWMutex
errArgsForCall []struct {
arg1 string
}
StartLoggingStub func()
startLoggingMutex sync.RWMutex
startLoggingArgsForCall []struct{}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeAuditLogger) Debug(arg1 string) {
fake.debugMutex.Lock()
fake.debugArgsForCall = append(fake.debugArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("Debug", []interface{}{arg1})
fake.debugMutex.Unlock()
if fake.DebugStub != nil {
fake.DebugStub(arg1)
}
}
func (fake *FakeAuditLogger) DebugCallCount() int {
fake.debugMutex.RLock()
defer fake.debugMutex.RUnlock()
return len(fake.debugArgsForCall)
}
func (fake *FakeAuditLogger) DebugArgsForCall(i int) string {
fake.debugMutex.RLock()
defer fake.debugMutex.RUnlock()
return fake.debugArgsForCall[i].arg1
}
func (fake *FakeAuditLogger) Err(arg1 string) {
fake.errMutex.Lock()
fake.errArgsForCall = append(fake.errArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("Err", []interface{}{arg1})
fake.errMutex.Unlock()
if fake.ErrStub != nil {
fake.ErrStub(arg1)
}
}
func (fake *FakeAuditLogger) ErrCallCount() int {
fake.errMutex.RLock()
defer fake.errMutex.RUnlock()
return len(fake.errArgsForCall)
}
func (fake *FakeAuditLogger) ErrArgsForCall(i int) string {
fake.errMutex.RLock()
defer fake.errMutex.RUnlock()
return fake.errArgsForCall[i].arg1
}
func (fake *FakeAuditLogger) StartLogging() {
fake.startLoggingMutex.Lock()
fake.startLoggingArgsForCall = append(fake.startLoggingArgsForCall, struct{}{})
fake.recordInvocation("StartLogging", []interface{}{})
fake.startLoggingMutex.Unlock()
if fake.StartLoggingStub != nil {
fake.StartLoggingStub()
}
}
func (fake *FakeAuditLogger) StartLoggingCallCount() int {
fake.startLoggingMutex.RLock()
defer fake.startLoggingMutex.RUnlock()
return len(fake.startLoggingArgsForCall)
}
func (fake *FakeAuditLogger) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.debugMutex.RLock()
defer fake.debugMutex.RUnlock()
fake.errMutex.RLock()
defer fake.errMutex.RUnlock()
fake.startLoggingMutex.RLock()
defer fake.startLoggingMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeAuditLogger) 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 _ platform.AuditLogger = new(FakeAuditLogger)