+ if context.removeServedNrCellsParams != nil {
+ writerMock.On("RemoveServedNrCells", RanName, context.removeServedNrCellsParams.servedNrCells).Return(context.removeServedNrCellsParams.err)
+ }
+
+ if context.updateGnbCellsParams != nil {
+ updatedNodebInfo := *context.getNodebInfoResult.nodebInfo
+ gnb := entities.Gnb{}
+ _ = jsonpb.Unmarshal(getJsonRequestAsBuffer(context.requestBody), &gnb)
+ updatedGnb := *updatedNodebInfo.GetGnb()
+ updatedGnb.ServedNrCells = gnb.ServedNrCells
+ writerMock.On("UpdateGnbCells", &updatedNodebInfo, gnb.ServedNrCells).Return(context.updateGnbCellsParams.err)
+ }
+}
+
+func assertControllerUpdateGnb(t *testing.T, context *controllerUpdateGnbTestContext, writer *httptest.ResponseRecorder, readerMock *mocks.RnibReaderMock, writerMock *mocks.RnibWriterMock) {
+ assert.Equal(t, context.expectedStatusCode, writer.Result().StatusCode)
+ bodyBytes, _ := ioutil.ReadAll(writer.Body)
+ assert.Equal(t, context.expectedJsonResponse, string(bodyBytes))
+ readerMock.AssertExpectations(t)
+ writerMock.AssertExpectations(t)
+
+ if context.getNodebInfoResult != nil {
+ readerMock.AssertNotCalled(t, "GetNodeb")
+ }
+
+ if context.updateGnbCellsParams != nil {
+ writerMock.AssertNotCalled(t, "UpdateGnb")
+ }
+
+ if context.removeServedNrCellsParams != nil {
+ writerMock.AssertNotCalled(t, "RemoveServedNrCells")
+ }
+}
+
+func buildUpdateGnbRequest(context *controllerUpdateGnbTestContext) *http.Request {