[RIC-621] - Fix Automation
[ric-plt/e2mgr.git] / E2Manager / mocks / rnibWriterMock.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 RnibWriterMock struct {
28         mock.Mock
29 }
30
31 func (rnibWriterMock *RnibWriterMock) SaveNodeb(nodebInfo *entities.NodebInfo) error {
32         args := rnibWriterMock.Called(nodebInfo)
33
34         errArg := args.Get(0)
35
36         if errArg != nil {
37                 return errArg.(error)
38         }
39
40         return nil
41 }
42
43 func (rnibWriterMock *RnibWriterMock) UpdateNodebInfo(nodebInfo *entities.NodebInfo) error {
44         args := rnibWriterMock.Called(nodebInfo)
45
46         errArg := args.Get(0)
47
48         if errArg != nil {
49                 return errArg.(error)
50         }
51
52         return nil
53 }
54
55 func (rnibWriterMock *RnibWriterMock) SaveRanLoadInformation(inventoryName string, ranLoadInformation *entities.RanLoadInformation) error {
56         args := rnibWriterMock.Called(inventoryName, ranLoadInformation)
57
58         errArg := args.Get(0)
59
60         if errArg != nil {
61                 return errArg.(error)
62         }
63
64         return nil
65 }
66
67 func (rnibWriterMock *RnibWriterMock) SaveE2TInstance(e2tInstance *entities.E2TInstance) error {
68         args := rnibWriterMock.Called(e2tInstance)
69
70         return args.Error(0)
71 }
72
73 func (rnibWriterMock *RnibWriterMock) SaveE2TAddresses(addresses []string) error {
74         args := rnibWriterMock.Called(addresses)
75
76         return args.Error(0)
77 }
78
79 func (rnibWriterMock *RnibWriterMock) RemoveE2TInstance(address string) error {
80         args := rnibWriterMock.Called(address)
81
82         return args.Error(0)
83 }
84
85 func (rnibWriterMock *RnibWriterMock) UpdateGnbCells(nodebInfo *entities.NodebInfo, servedNrCells []*entities.ServedNRCell) error {
86         args := rnibWriterMock.Called(nodebInfo, servedNrCells)
87         return args.Error(0)
88 }
89
90 func (rnibWriterMock *RnibWriterMock) RemoveServedNrCells(inventoryName string, servedNrCells []*entities.ServedNRCell) error {
91         args := rnibWriterMock.Called(inventoryName, servedNrCells)
92         return args.Error(0)
93 }
94
95 func (rnibWriterMock *RnibWriterMock) UpdateNodebInfoOnConnectionStatusInversion(nodebInfo *entities.NodebInfo, event string) error {
96         args := rnibWriterMock.Called(nodebInfo, event)
97
98         return args.Error(0)
99 }
100
101 func (rnibWriterMock *RnibWriterMock) SaveGeneralConfiguration(config *entities.GeneralConfiguration) error {
102         args := rnibWriterMock.Called(config)
103
104         return args.Error(0)
105 }
106
107 func (rnibWriterMock *RnibWriterMock) RemoveEnb(nodebInfo *entities.NodebInfo) error {
108         args := rnibWriterMock.Called(nodebInfo)
109
110         return args.Error(0)
111 }
112
113 func (rnibWriterMock *RnibWriterMock) RemoveServedCells(inventoryName string, servedCells []*entities.ServedCellInfo) error {
114         args := rnibWriterMock.Called(inventoryName, servedCells)
115
116         return args.Error(0)
117 }
118
119 func (rnibWriterMock *RnibWriterMock) UpdateEnb(nodebInfo *entities.NodebInfo, servedCells []*entities.ServedCellInfo) error {
120         args := rnibWriterMock.Called(nodebInfo, servedCells)
121
122         return args.Error(0)
123 }
124
125 func (rnibWriterMock *RnibWriterMock) AddNbIdentity(nodeType entities.Node_Type, nbIdentity *entities.NbIdentity) error {
126         args := rnibWriterMock.Called(nodeType, nbIdentity)
127         return args.Error(0)
128 }
129 func (rnibWriterMock *RnibWriterMock) RemoveNbIdentity(nodeType entities.Node_Type, nbIdentity *entities.NbIdentity) error {
130         args := rnibWriterMock.Called(nodeType, nbIdentity)
131         return args.Error(0)
132 }
133
134 func (rnibWriterMock *RnibWriterMock) AddEnb(nodebInfo *entities.NodebInfo) error {
135         args := rnibWriterMock.Called(nodebInfo)
136         return args.Error(0)
137 }