[RIC-587] Update E2 Setup existing nodeb behavior
[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) UpdateNodebInfoAndPublish(nodebInfo *entities.NodebInfo) error {
56         args := rnibWriterMock.Called(nodebInfo)
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) SaveRanLoadInformation(inventoryName string, ranLoadInformation *entities.RanLoadInformation) error {
68         args := rnibWriterMock.Called(inventoryName, ranLoadInformation)
69
70         errArg := args.Get(0)
71
72         if errArg != nil {
73                 return errArg.(error)
74         }
75
76         return nil
77 }
78
79 func (rnibWriterMock *RnibWriterMock) SaveE2TInstance(e2tInstance *entities.E2TInstance) error {
80         args := rnibWriterMock.Called(e2tInstance)
81
82         return args.Error(0)
83 }
84
85 func (rnibWriterMock *RnibWriterMock) SaveE2TAddresses(addresses []string) error {
86         args := rnibWriterMock.Called(addresses)
87
88         return args.Error(0)
89 }
90
91 func (rnibWriterMock *RnibWriterMock) RemoveE2TInstance(address string) error {
92         args := rnibWriterMock.Called(address)
93
94         return args.Error(0)
95 }
96
97 func (rnibWriterMock *RnibWriterMock) UpdateGnbCells(nodebInfo *entities.NodebInfo, servedNrCells []*entities.ServedNRCell) error {
98         args := rnibWriterMock.Called(nodebInfo, servedNrCells)
99         return args.Error(0)
100 }
101
102 func (rnibWriterMock *RnibWriterMock) RemoveServedNrCells(inventoryName string, servedNrCells []*entities.ServedNRCell) error {
103         args := rnibWriterMock.Called(inventoryName, servedNrCells)
104         return args.Error(0)
105 }
106
107 func (rnibWriterMock *RnibWriterMock) UpdateNodebInfoOnConnectionStatusInversion(nodebInfo *entities.NodebInfo, event string) error {
108         args := rnibWriterMock.Called(nodebInfo, event)
109
110         return args.Error(0)
111 }
112
113 func (rnibWriterMock *RnibWriterMock) SaveGeneralConfiguration(config *entities.GeneralConfiguration) error {
114         args := rnibWriterMock.Called(config)
115
116         return args.Error(0)
117 }
118
119 func (rnibWriterMock *RnibWriterMock) RemoveEnb(nodebInfo *entities.NodebInfo) error {
120         args := rnibWriterMock.Called(nodebInfo)
121
122         return args.Error(0)
123 }
124
125 func (rnibWriterMock *RnibWriterMock) RemoveServedCells(inventoryName string, servedCells []*entities.ServedCellInfo) error {
126         args := rnibWriterMock.Called(inventoryName, servedCells)
127
128         return args.Error(0)
129 }
130
131 func (rnibWriterMock *RnibWriterMock) UpdateEnb(nodebInfo *entities.NodebInfo, servedCells []*entities.ServedCellInfo) error {
132         args := rnibWriterMock.Called(nodebInfo, servedCells)
133
134         return args.Error(0)
135 }
136
137 func (rnibWriterMock *RnibWriterMock) AddNbIdentity(nodeType entities.Node_Type, nbIdentity *entities.NbIdentity) error {
138         args := rnibWriterMock.Called(nodeType, nbIdentity)
139         return args.Error(0)
140 }
141 func (rnibWriterMock *RnibWriterMock) RemoveNbIdentity(nodeType entities.Node_Type, nbIdentity *entities.NbIdentity) error {
142         args := rnibWriterMock.Called(nodeType, nbIdentity)
143         return args.Error(0)
144 }
145
146 func (rnibWriterMock *RnibWriterMock) AddEnb(nodebInfo *entities.NodebInfo) error {
147         args := rnibWriterMock.Called(nodebInfo)
148         return args.Error(0)
149 }