-
Notifications
You must be signed in to change notification settings - Fork 23
/
fake_global_request_handler.go
85 lines (75 loc) · 2.77 KB
/
fake_global_request_handler.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
// Code generated by counterfeiter. DO NOT EDIT.
package fake_handlers
import (
"sync"
"code.cloudfoundry.org/diego-ssh/handlers"
"code.cloudfoundry.org/diego-ssh/helpers"
"code.cloudfoundry.org/lager/v3"
"golang.org/x/crypto/ssh"
)
type FakeGlobalRequestHandler struct {
HandleRequestStub func(lager.Logger, *ssh.Request, ssh.Conn, *helpers.ListenerStore)
handleRequestMutex sync.RWMutex
handleRequestArgsForCall []struct {
arg1 lager.Logger
arg2 *ssh.Request
arg3 ssh.Conn
arg4 *helpers.ListenerStore
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeGlobalRequestHandler) HandleRequest(arg1 lager.Logger, arg2 *ssh.Request, arg3 ssh.Conn, arg4 *helpers.ListenerStore) {
fake.handleRequestMutex.Lock()
fake.handleRequestArgsForCall = append(fake.handleRequestArgsForCall, struct {
arg1 lager.Logger
arg2 *ssh.Request
arg3 ssh.Conn
arg4 *helpers.ListenerStore
}{arg1, arg2, arg3, arg4})
fake.recordInvocation("HandleRequest", []interface{}{arg1, arg2, arg3, arg4})
handleRequestStubCopy := fake.HandleRequestStub
fake.handleRequestMutex.Unlock()
if handleRequestStubCopy != nil {
handleRequestStubCopy(arg1, arg2, arg3, arg4)
}
}
func (fake *FakeGlobalRequestHandler) HandleRequestCallCount() int {
fake.handleRequestMutex.RLock()
defer fake.handleRequestMutex.RUnlock()
return len(fake.handleRequestArgsForCall)
}
func (fake *FakeGlobalRequestHandler) HandleRequestCalls(stub func(lager.Logger, *ssh.Request, ssh.Conn, *helpers.ListenerStore)) {
fake.handleRequestMutex.Lock()
defer fake.handleRequestMutex.Unlock()
fake.HandleRequestStub = stub
}
func (fake *FakeGlobalRequestHandler) HandleRequestArgsForCall(i int) (lager.Logger, *ssh.Request, ssh.Conn, *helpers.ListenerStore) {
fake.handleRequestMutex.RLock()
defer fake.handleRequestMutex.RUnlock()
argsForCall := fake.handleRequestArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}
func (fake *FakeGlobalRequestHandler) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.handleRequestMutex.RLock()
defer fake.handleRequestMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeGlobalRequestHandler) 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 _ handlers.GlobalRequestHandler = new(FakeGlobalRequestHandler)