2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 // This source code is part of the near-RT RIC (RAN Intelligent Controller)
18 // platform project (RICP).
22 import "github.com/stretchr/testify/mock"
24 //Deprecated: Will be removed in a future release, please use MockSdlSyncStorage instead.
25 type MockSdlInstance struct {
29 //Deprecated: Will be removed in a future release, please use instead the SubscribeChannel
30 //receiver function of the MockSdlSyncStorage type.
31 func (m *MockSdlInstance) SubscribeChannel(cb func(string, ...string), channels ...string) error {
32 a := m.Called(cb, channels)
36 //Deprecated: Will be removed in a future release, please use instead the UnsubscribeChannel
37 //receiver function of the MockSdlSyncStorage type.
38 func (m *MockSdlInstance) UnsubscribeChannel(channels ...string) error {
39 a := m.Called(channels)
43 //Deprecated: Will be removed in a future release, please use instead the SetAndPublish
44 //receiver function of the MockSdlSyncStorage type.
45 func (m *MockSdlInstance) SetAndPublish(channelsAndEvents []string, pairs ...interface{}) error {
46 a := m.Called(channelsAndEvents, pairs)
50 //Deprecated: Will be removed in a future release, please use instead the SetIfAndPublish
51 //receiver function of the MockSdlSyncStorage type.
52 func (m *MockSdlInstance) SetIfAndPublish(channelsAndEvents []string, key string, oldData, newData interface{}) (bool, error) {
53 a := m.Called(channelsAndEvents, key, oldData, newData)
54 return a.Bool(0), a.Error(1)
57 //Deprecated: Will be removed in a future release, please use instead the SetIfNotExistsAndPublish
58 //receiver function of the MockSdlSyncStorage type.
59 func (m *MockSdlInstance) SetIfNotExistsAndPublish(channelsAndEvents []string, key string, data interface{}) (bool, error) {
60 a := m.Called(channelsAndEvents, key, data)
61 return a.Bool(0), a.Error(1)
64 //Deprecated: Will be removed in a future release, please use instead the RemoveAndPublish
65 //receiver function of the MockSdlSyncStorage type.
66 func (m *MockSdlInstance) RemoveAndPublish(channelsAndEvents []string, keys []string) error {
67 a := m.Called(channelsAndEvents, keys)
71 //Deprecated: Will be removed in a future release, please use instead the RemoveIfAndPublish
72 //receiver function of the MockSdlSyncStorage type.
73 func (m *MockSdlInstance) RemoveIfAndPublish(channelsAndEvents []string, key string, data interface{}) (bool, error) {
74 a := m.Called(channelsAndEvents, key, data)
75 return a.Bool(0), a.Error(1)
78 //Deprecated: Will be removed in a future release, please use instead the RemoveAllAndPublish
79 //receiver function of the MockSdlSyncStorage type.
80 func (m *MockSdlInstance) RemoveAllAndPublish(channelsAndEvents []string) error {
81 a := m.Called(channelsAndEvents)
85 //Deprecated: Will be removed in a future release, please use instead the Set
86 //receiver function of the MockSdlSyncStorage type.
87 func (m *MockSdlInstance) Set(pairs ...interface{}) error {
92 //Deprecated: Will be removed in a future release, please use instead the Get
93 //receiver function of the MockSdlSyncStorage type.
94 func (m *MockSdlInstance) Get(keys []string) (map[string]interface{}, error) {
96 return a.Get(0).(map[string]interface{}), a.Error(1)
99 //Deprecated: Will be removed in a future release, please use instead the GetAll
100 //receiver function of the MockSdlSyncStorage type.
101 func (m *MockSdlInstance) GetAll() ([]string, error) {
103 return a.Get(0).([]string), a.Error(1)
106 //Deprecated: Will be removed in a future release, please use instead the Close
107 //receiver function of the MockSdlSyncStorage type.
108 func (m *MockSdlInstance) Close() error {
113 //Deprecated: Will be removed in a future release, please use instead the Remove
114 //receiver function of the MockSdlSyncStorage type.
115 func (m *MockSdlInstance) Remove(keys []string) error {
120 //Deprecated: Will be removed in a future release, please use instead the RemoveAll
121 //receiver function of the MockSdlSyncStorage type.
122 func (m *MockSdlInstance) RemoveAll() error {
127 //Deprecated: Will be removed in a future release, please use instead the SetIf
128 //receiver function of the MockSdlSyncStorage type.
129 func (m *MockSdlInstance) SetIf(key string, oldData, newData interface{}) (bool, error) {
130 a := m.Called(key, oldData, newData)
131 return a.Bool(0), a.Error(1)
134 //Deprecated: Will be removed in a future release, please use instead the SetIfNotExists
135 //receiver function of the MockSdlSyncStorage type.
136 func (m *MockSdlInstance) SetIfNotExists(key string, data interface{}) (bool, error) {
137 a := m.Called(key, data)
138 return a.Bool(0), a.Error(1)
141 //Deprecated: Will be removed in a future release, please use instead the RemoveIf
142 //receiver function of the MockSdlSyncStorage type.
143 func (m *MockSdlInstance) RemoveIf(key string, data interface{}) (bool, error) {
144 a := m.Called(key, data)
145 return a.Bool(0), a.Error(1)
148 //Deprecated: Will be removed in a future release, please use instead the AddMember
149 //receiver function of the MockSdlSyncStorage type.
150 func (m *MockSdlInstance) AddMember(group string, member ...interface{}) error {
151 a := m.Called(group, member)
155 //Deprecated: Will be removed in a future release, please use instead the RemoveMember
156 //receiver function of the MockSdlSyncStorage type.
157 func (m *MockSdlInstance) RemoveMember(group string, member ...interface{}) error {
158 a := m.Called(group, member)
162 //Deprecated: Will be removed in a future release, please use instead the RemoveGroup
163 //receiver function of the MockSdlSyncStorage type.
164 func (m *MockSdlInstance) RemoveGroup(group string) error {
169 //Deprecated: Will be removed in a future release, please use instead the GetMembers
170 //receiver function of the MockSdlSyncStorage type.
171 func (m *MockSdlInstance) GetMembers(group string) ([]string, error) {
173 return a.Get(0).([]string), a.Error(1)
176 //Deprecated: Will be removed in a future release, please use instead the IsMember
177 //receiver function of the MockSdlSyncStorage type.
178 func (m *MockSdlInstance) IsMember(group string, member interface{}) (bool, error) {
179 a := m.Called(group, member)
180 return a.Bool(0), a.Error(1)
183 //Deprecated: Will be removed in a future release, please use instead the GroupSize
184 //receiver function of the MockSdlSyncStorage type.
185 func (m *MockSdlInstance) GroupSize(group string) (int64, error) {
186 a := m.Called(group, )
187 return int64(a.Int(0)), a.Error(1)