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