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