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