-
Notifications
You must be signed in to change notification settings - Fork 1
/
mock_provider.go
77 lines (61 loc) · 2.72 KB
/
mock_provider.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
package zigbee
import (
"context"
"github.com/stretchr/testify/mock"
)
var _ Provider = (*MockProvider)(nil)
type MockProvider struct {
mock.Mock
}
func (m *MockProvider) RequestNodeLeave(ctx context.Context, networkAddress IEEEAddress) error {
args := m.Called(ctx, networkAddress)
return args.Error(0)
}
func (m *MockProvider) ForceNodeLeave(ctx context.Context, networkAddress IEEEAddress) error {
args := m.Called(ctx, networkAddress)
return args.Error(0)
}
func (m *MockProvider) PermitJoin(ctx context.Context, allRouters bool) error {
args := m.Called(ctx, allRouters)
return args.Error(0)
}
func (m *MockProvider) DenyJoin(ctx context.Context) error {
args := m.Called(ctx)
return args.Error(0)
}
func (m *MockProvider) AdapterNode() Node {
args := m.Called()
return args.Get(0).(Node)
}
func (m *MockProvider) QueryNodeDescription(ctx context.Context, networkAddress IEEEAddress) (NodeDescription, error) {
args := m.Called(ctx, networkAddress)
return args.Get(0).(NodeDescription), args.Error(1)
}
func (m *MockProvider) QueryNodeEndpoints(ctx context.Context, networkAddress IEEEAddress) ([]Endpoint, error) {
args := m.Called(ctx, networkAddress)
return args.Get(0).([]Endpoint), args.Error(1)
}
func (m *MockProvider) QueryNodeEndpointDescription(ctx context.Context, networkAddress IEEEAddress, endpoint Endpoint) (EndpointDescription, error) {
args := m.Called(ctx, networkAddress, endpoint)
return args.Get(0).(EndpointDescription), args.Error(1)
}
func (m *MockProvider) BindNodeToController(ctx context.Context, nodeAddress IEEEAddress, sourceEndpoint Endpoint, destinationEndpoint Endpoint, cluster ClusterID) error {
args := m.Called(ctx, nodeAddress, sourceEndpoint, destinationEndpoint, cluster)
return args.Error(0)
}
func (m *MockProvider) UnbindNodeFromController(ctx context.Context, nodeAddress IEEEAddress, sourceEndpoint Endpoint, destinationEndpoint Endpoint, cluster ClusterID) error {
args := m.Called(ctx, nodeAddress, sourceEndpoint, destinationEndpoint, cluster)
return args.Error(0)
}
func (m *MockProvider) SendApplicationMessageToNode(ctx context.Context, destinationAddress IEEEAddress, message ApplicationMessage, requireAck bool) error {
args := m.Called(ctx, destinationAddress, message, requireAck)
return args.Error(0)
}
func (m *MockProvider) ReadEvent(ctx context.Context) (interface{}, error) {
args := m.Called(ctx)
return args.Get(0), args.Error(1)
}
func (m *MockProvider) RegisterAdapterEndpoint(ctx context.Context, endpoint Endpoint, appProfileId ProfileID, appDeviceId uint16, appDeviceVersion uint8, inClusters []ClusterID, outClusters []ClusterID) error {
args := m.Called(ctx, endpoint, appProfileId, appDeviceId, appDeviceVersion, inClusters, outClusters)
return args.Error(0)
}