efeb5e042bea9270d3f5de3a78b662d10f2edab8
[ric-plt/resource-status-manager.git] / RSM / mocks / sdl_instance_mock.go
1 //
2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //      http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16
17 //  This source code is part of the near-RT RIC (RAN Intelligent Controller)
18 //  platform project (RICP).
19
20 package mocks
21
22 import "github.com/stretchr/testify/mock"
23
24 type MockSdlInstance struct {
25         mock.Mock
26 }
27
28 func (m *MockSdlInstance) SubscribeChannel(cb func(string, ...string), channels ...string) error {
29         a := m.Called(cb, channels)
30         return a.Error(0)
31 }
32
33 func (m *MockSdlInstance) UnsubscribeChannel(channels ...string) error {
34         a := m.Called(channels)
35         return a.Error(0)
36 }
37
38 func (m *MockSdlInstance) SetAndPublish(channelsAndEvents []string, pairs ...interface{}) error {
39         a := m.Called(channelsAndEvents, pairs)
40         return a.Error(0)
41 }
42
43 func (m *MockSdlInstance) SetIfAndPublish(channelsAndEvents []string, key string, oldData, newData interface{}) (bool, error) {
44         a := m.Called(channelsAndEvents, key, oldData, newData)
45         return a.Bool(0), a.Error(1)
46 }
47
48 func (m *MockSdlInstance) SetIfNotExistsAndPublish(channelsAndEvents []string, key string, data interface{}) (bool, error) {
49         a := m.Called(channelsAndEvents, key, data)
50         return a.Bool(0), a.Error(1)
51 }
52
53 func (m *MockSdlInstance) RemoveAndPublish(channelsAndEvents []string, keys []string) error {
54         a := m.Called(channelsAndEvents, keys)
55         return a.Error(0)
56 }
57
58 func (m *MockSdlInstance) RemoveIfAndPublish(channelsAndEvents []string, key string, data interface{}) (bool, error) {
59         a := m.Called(channelsAndEvents, key, data)
60         return a.Bool(0), a.Error(1)
61 }
62
63 func (m *MockSdlInstance) RemoveAllAndPublish(channelsAndEvents []string) error {
64         a := m.Called(channelsAndEvents)
65         return a.Error(0)
66 }
67
68 func (m *MockSdlInstance) Set(pairs ...interface{}) error {
69         a := m.Called(pairs)
70         return a.Error(0)
71 }
72
73 func (m *MockSdlInstance) Get(keys []string) (map[string]interface{}, error) {
74         a := m.Called(keys)
75         return a.Get(0).(map[string]interface{}), a.Error(1)
76 }
77
78 func (m *MockSdlInstance) GetAll() ([]string, error) {
79         a := m.Called()
80         return a.Get(0).([]string), a.Error(1)
81 }
82
83 func (m *MockSdlInstance) Close() error {
84         a := m.Called()
85         return a.Error(0)
86 }
87
88 func (m *MockSdlInstance) Remove(keys []string) error {
89         a := m.Called(keys)
90         return a.Error(0)
91 }
92
93 func (m *MockSdlInstance) RemoveAll() error {
94         a := m.Called()
95         return a.Error(0)
96 }
97
98 func (m *MockSdlInstance) SetIf(key string, oldData, newData interface{}) (bool, error) {
99         a := m.Called(key, oldData, newData)
100         return a.Bool(0), a.Error(1)
101 }
102
103 func (m *MockSdlInstance) SetIfNotExists(key string, data interface{}) (bool, error) {
104         a := m.Called(key, data)
105         return a.Bool(0), a.Error(1)
106 }
107 func (m *MockSdlInstance) RemoveIf(key string, data interface{}) (bool, error) {
108         a := m.Called(key, data)
109         return a.Bool(0), a.Error(1)
110 }
111
112 func (m *MockSdlInstance) AddMember(group string, member ...interface{}) error {
113         a := m.Called(group, member)
114         return a.Error(0)
115 }
116
117 func (m *MockSdlInstance) RemoveMember(group string, member ...interface{}) error {
118         a := m.Called(group, member)
119         return a.Error(0)
120 }
121 func (m *MockSdlInstance) RemoveGroup(group string) error {
122         a := m.Called(group)
123         return a.Error(0)
124 }
125 func (m *MockSdlInstance) GetMembers(group string) ([]string, error) {
126         a := m.Called(group)
127         return a.Get(0).([]string), a.Error(1)
128 }
129 func (m *MockSdlInstance) IsMember(group string, member interface{}) (bool, error) {
130         a := m.Called(group, member)
131         return a.Bool(0), a.Error(1)
132 }
133 func (m *MockSdlInstance) GroupSize(group string) (int64, error) {
134         a := m.Called(group)
135         return int64(a.Int(0)), a.Error(1)
136 }