-
Notifications
You must be signed in to change notification settings - Fork 70
/
fake_publishing_connection.go
72 lines (63 loc) · 1.74 KB
/
fake_publishing_connection.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
// This file was generated by counterfeiter
package fakes
import (
"route_populator/publisher"
"sync"
)
type FakePublishingConnection struct {
PublishStub func(subj string, data []byte) error
publishMutex sync.RWMutex
publishArgsForCall []struct {
subj string
data []byte
}
publishReturns struct {
result1 error
}
CloseStub func()
closeMutex sync.RWMutex
closeArgsForCall []struct{}
}
func (fake *FakePublishingConnection) Publish(subj string, data []byte) error {
fake.publishMutex.Lock()
fake.publishArgsForCall = append(fake.publishArgsForCall, struct {
subj string
data []byte
}{subj, data})
fake.publishMutex.Unlock()
if fake.PublishStub != nil {
return fake.PublishStub(subj, data)
} else {
return fake.publishReturns.result1
}
}
func (fake *FakePublishingConnection) PublishCallCount() int {
fake.publishMutex.RLock()
defer fake.publishMutex.RUnlock()
return len(fake.publishArgsForCall)
}
func (fake *FakePublishingConnection) PublishArgsForCall(i int) (string, []byte) {
fake.publishMutex.RLock()
defer fake.publishMutex.RUnlock()
return fake.publishArgsForCall[i].subj, fake.publishArgsForCall[i].data
}
func (fake *FakePublishingConnection) PublishReturns(result1 error) {
fake.PublishStub = nil
fake.publishReturns = struct {
result1 error
}{result1}
}
func (fake *FakePublishingConnection) Close() {
fake.closeMutex.Lock()
fake.closeArgsForCall = append(fake.closeArgsForCall, struct{}{})
fake.closeMutex.Unlock()
if fake.CloseStub != nil {
fake.CloseStub()
}
}
func (fake *FakePublishingConnection) CloseCallCount() int {
fake.closeMutex.RLock()
defer fake.closeMutex.RUnlock()
return len(fake.closeArgsForCall)
}
var _ publisher.PublishingConnection = new(FakePublishingConnection)