Copy latest code to master
[ric-plt/resource-status-manager.git] / RSM / mocks / rnib_reader_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 (
23         "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
24         "github.com/stretchr/testify/mock"
25 )
26
27 type RnibReaderMock struct {
28         mock.Mock
29 }
30
31 func (m *RnibReaderMock) GetNodeb(inventoryName string) (*entities.NodebInfo, error) {
32         args := m.Called(inventoryName)
33
34         errArg := args.Get(1)
35
36         if errArg != nil {
37                 return args.Get(0).(*entities.NodebInfo), errArg.(error)
38         }
39
40         return args.Get(0).(*entities.NodebInfo), nil
41 }
42
43 func (m *RnibReaderMock) GetNodebByGlobalNbId(nodeType entities.Node_Type, globalNbId *entities.GlobalNbId) (*entities.NodebInfo, error) {
44         args := m.Called(nodeType, globalNbId)
45
46         errArg := args.Get(1)
47
48         if errArg != nil {
49                 return args.Get(0).(*entities.NodebInfo), errArg.(error)
50         }
51
52         return args.Get(0).(*entities.NodebInfo), nil
53 }
54
55 func (m *RnibReaderMock) GetCellList(inventoryName string) (*entities.Cells, error) {
56         args := m.Called(inventoryName)
57
58         errArg := args.Get(1)
59
60         if errArg != nil {
61                 return args.Get(0).(*entities.Cells), errArg.(error)
62         }
63
64         return args.Get(0).(*entities.Cells), nil
65 }
66
67 func (m *RnibReaderMock) GetListGnbIds() ([]*entities.NbIdentity, error) {
68         args := m.Called()
69
70         errArg := args.Get(1)
71
72         if errArg != nil {
73                 return args.Get(0).([]*entities.NbIdentity), errArg.(error)
74         }
75
76         return args.Get(0).([]*entities.NbIdentity), nil
77 }
78
79 func (m *RnibReaderMock) GetListEnbIds() ([]*entities.NbIdentity, error) {
80         args := m.Called()
81
82         errArg := args.Get(1)
83
84         if errArg != nil {
85                 return args.Get(0).([]*entities.NbIdentity), errArg.(error)
86         }
87
88         return args.Get(0).([]*entities.NbIdentity), nil
89
90 }
91
92 func (m *RnibReaderMock) GetCountGnbList() (int, error) {
93         args := m.Called()
94
95         errArg := args.Get(1)
96
97         if errArg != nil {
98                 return args.Int(0), errArg.(error)
99         }
100
101         return args.Int(0), nil
102
103 }
104
105 func (m *RnibReaderMock) GetCell(inventoryName string, pci uint32) (*entities.Cell, error) {
106         args := m.Called(inventoryName, pci)
107
108         errArg := args.Get(1)
109
110         if errArg != nil {
111                 return args.Get(0).(*entities.Cell), errArg.(error)
112         }
113
114         return args.Get(0).(*entities.Cell), nil
115 }
116
117 func (m *RnibReaderMock) GetCellById(cellType entities.Cell_Type, cellId string) (*entities.Cell, error) {
118         args := m.Called(cellType, cellId)
119
120         errArg := args.Get(1)
121
122         if errArg != nil {
123                 return args.Get(0).(*entities.Cell), errArg.(error)
124         }
125
126         return args.Get(0).(*entities.Cell), nil
127 }
128
129 func (m *RnibReaderMock) GetListNodebIds() ([]*entities.NbIdentity, error) {
130         args := m.Called()
131
132         errArg := args.Get(1)
133
134         if errArg != nil {
135                 return args.Get(0).([]*entities.NbIdentity), errArg.(error)
136         }
137
138         return args.Get(0).([]*entities.NbIdentity), nil
139 }
140
141 func (m *RnibReaderMock) GetRanLoadInformation(inventoryName string) (*entities.RanLoadInformation, error) {
142         args := m.Called()
143
144         errArg := args.Get(1)
145
146         if errArg != nil {
147                 return args.Get(0).(*entities.RanLoadInformation), errArg.(error)
148         }
149
150         return args.Get(0).(*entities.RanLoadInformation), nil
151 }
152
153 func (m *RnibReaderMock) GetE2TInstance(e2taddress string) (*entities.E2TInstance, error) {
154         args := m.Called(e2taddress)
155         return args.Get(0).(*entities.E2TInstance), args.Error(1)
156 }
157
158 func (m *RnibReaderMock) GetE2TInstances(addresses []string) ([]*entities.E2TInstance, error) {
159         args := m.Called(addresses)
160         return args.Get(0).([]*entities.E2TInstance), args.Error(1)
161 }
162
163 func (m *RnibReaderMock) GetE2TAddresses() ([]string, error) {
164         args := m.Called()
165         return args.Get(0).([]string), args.Error(1)
166 }