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).
23 "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
24 "github.com/stretchr/testify/mock"
27 type RnibReaderMock struct {
31 func (m *RnibReaderMock) GetNodeb(inventoryName string) (*entities.NodebInfo, error) {
32 args := m.Called(inventoryName)
34 errArg := args.Get(1);
36 return args.Get(0).(*entities.NodebInfo), errArg.(error);
39 return args.Get(0).(*entities.NodebInfo), nil
42 func (m *RnibReaderMock) GetNodebByGlobalNbId(nodeType entities.Node_Type, globalNbId *entities.GlobalNbId) (*entities.NodebInfo, error) {
43 args := m.Called(nodeType, globalNbId)
45 errArg := args.Get(1);
47 return args.Get(0).(*entities.NodebInfo), errArg.(error);
50 return args.Get(0).(*entities.NodebInfo), nil
53 func (m *RnibReaderMock) GetCellList(inventoryName string) (*entities.Cells, error) {
54 args := m.Called(inventoryName)
56 errArg := args.Get(1);
58 return args.Get(0).(*entities.Cells), errArg.(error);
61 return args.Get(0).(*entities.Cells), nil
64 func (m *RnibReaderMock) GetListGnbIds() ([]*entities.NbIdentity, error) {
67 errArg := args.Get(1);
69 return args.Get(0).([]*entities.NbIdentity), errArg.(error);
72 return args.Get(0).([]*entities.NbIdentity), nil
75 func (m *RnibReaderMock) GetListEnbIds() ([]*entities.NbIdentity, error) {
78 errArg := args.Get(1);
80 return args.Get(0).([]*entities.NbIdentity), errArg.(error);
83 return args.Get(0).([]*entities.NbIdentity), nil
87 func (m *RnibReaderMock) GetCountGnbList() (int, error) {
90 errArg := args.Get(1);
92 return args.Int(0), errArg.(error);
95 return args.Int(0), nil
99 func (m *RnibReaderMock) GetCell(inventoryName string, pci uint32) (*entities.Cell, error) {
100 args := m.Called(inventoryName, pci)
102 errArg := args.Get(1);
104 return args.Get(0).(*entities.Cell), errArg.(error);
107 return args.Get(0).(*entities.Cell), nil
110 func (m *RnibReaderMock) GetCellById(cellType entities.Cell_Type, cellId string) (*entities.Cell, error) {
111 args := m.Called(cellType, cellId)
113 errArg := args.Get(1);
115 return args.Get(0).(*entities.Cell), errArg.(error);
118 return args.Get(0).(*entities.Cell), nil
121 func (m *RnibReaderMock) GetListNodebIds() ([]*entities.NbIdentity, error) {
124 errArg := args.Get(1)
127 return args.Get(0).([]*entities.NbIdentity), errArg.(error)
130 return args.Get(0).([]*entities.NbIdentity), nil
133 func (m *RnibReaderMock) GetRanLoadInformation(inventoryName string) (*entities.RanLoadInformation, error) {
136 errArg := args.Get(1)
139 return args.Get(0).(*entities.RanLoadInformation), errArg.(error)
142 return args.Get(0).(*entities.RanLoadInformation), nil
145 func (m *RnibReaderMock) GetE2TInstance(e2taddress string) (*entities.E2TInstance, error) {
146 args := m.Called(e2taddress)
147 return args.Get(0).(*entities.E2TInstance), args.Error(1)
150 func (m *RnibReaderMock) GetE2TInstances(addresses []string) ([]*entities.E2TInstance, error) {
151 args := m.Called(addresses)
152 return args.Get(0).([]*entities.E2TInstance), args.Error(1)
155 func (m *RnibReaderMock) GetE2TAddresses() ([]string, error) {
157 return args.Get(0).([]string), args.Error(1)