-
Notifications
You must be signed in to change notification settings - Fork 21
/
fake_mysql_adapter.go
109 lines (99 loc) · 3.2 KB
/
fake_mysql_adapter.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
// Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"crypto/tls"
"sync"
)
type MySQLAdapter struct {
RegisterTLSConfigStub func(string, *tls.Config) error
registerTLSConfigMutex sync.RWMutex
registerTLSConfigArgsForCall []struct {
arg1 string
arg2 *tls.Config
}
registerTLSConfigReturns struct {
result1 error
}
registerTLSConfigReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *MySQLAdapter) RegisterTLSConfig(arg1 string, arg2 *tls.Config) error {
fake.registerTLSConfigMutex.Lock()
ret, specificReturn := fake.registerTLSConfigReturnsOnCall[len(fake.registerTLSConfigArgsForCall)]
fake.registerTLSConfigArgsForCall = append(fake.registerTLSConfigArgsForCall, struct {
arg1 string
arg2 *tls.Config
}{arg1, arg2})
fake.recordInvocation("RegisterTLSConfig", []interface{}{arg1, arg2})
fake.registerTLSConfigMutex.Unlock()
if fake.RegisterTLSConfigStub != nil {
return fake.RegisterTLSConfigStub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.registerTLSConfigReturns
return fakeReturns.result1
}
func (fake *MySQLAdapter) RegisterTLSConfigCallCount() int {
fake.registerTLSConfigMutex.RLock()
defer fake.registerTLSConfigMutex.RUnlock()
return len(fake.registerTLSConfigArgsForCall)
}
func (fake *MySQLAdapter) RegisterTLSConfigCalls(stub func(string, *tls.Config) error) {
fake.registerTLSConfigMutex.Lock()
defer fake.registerTLSConfigMutex.Unlock()
fake.RegisterTLSConfigStub = stub
}
func (fake *MySQLAdapter) RegisterTLSConfigArgsForCall(i int) (string, *tls.Config) {
fake.registerTLSConfigMutex.RLock()
defer fake.registerTLSConfigMutex.RUnlock()
argsForCall := fake.registerTLSConfigArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *MySQLAdapter) RegisterTLSConfigReturns(result1 error) {
fake.registerTLSConfigMutex.Lock()
defer fake.registerTLSConfigMutex.Unlock()
fake.RegisterTLSConfigStub = nil
fake.registerTLSConfigReturns = struct {
result1 error
}{result1}
}
func (fake *MySQLAdapter) RegisterTLSConfigReturnsOnCall(i int, result1 error) {
fake.registerTLSConfigMutex.Lock()
defer fake.registerTLSConfigMutex.Unlock()
fake.RegisterTLSConfigStub = nil
if fake.registerTLSConfigReturnsOnCall == nil {
fake.registerTLSConfigReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.registerTLSConfigReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *MySQLAdapter) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.registerTLSConfigMutex.RLock()
defer fake.registerTLSConfigMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *MySQLAdapter) 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)
}