+ if len(propToOmit) != 0 {
+ delete(ret, propToOmit)
+ }
+
+ return ret
+}
+
+func getUpdateEnbRequest(propToOmit string) map[string]interface{} {
+ ret := map[string]interface{}{
+ "enb": buildEnb(propToOmit),
+ }
+
+ if len(propToOmit) != 0 {
+ delete(ret, propToOmit)
+ }
+
+ return ret
+}
+
+func getAddEnbRequest(propToOmit string) map[string]interface{} {
+ ret := map[string]interface{}{
+ "ranName": RanName,
+ "globalNbId": buildGlobalNbId(""),
+ "enb": buildEnb(""),
+ }
+
+ if len(propToOmit) != 0 {
+ delete(ret, propToOmit)
+ }
+
+ return ret
+}
+
+func buildEnb(propToOmit string) map[string]interface{} {
+ ret := map[string]interface{}{
+ "enbType": 1,
+ "servedCells": []interface{}{
+ buildServedCell(""),
+ }}
+
+ if len(propToOmit) != 0 {
+ delete(ret, propToOmit)
+ }
+
+ return ret
+}
+
+func buildGlobalNbId(propToOmit string) map[string]interface{} {
+ ret := map[string]interface{}{
+ "plmnId": "whatever",
+ "nbId": "whatever2",
+ }
+
+ if len(propToOmit) != 0 {
+ delete(ret, propToOmit)
+ }
+
+ return ret
+}
+
+func setupControllerTest(t *testing.T) (*NodebController, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.RmrMessengerMock, *mocks.E2TInstancesManagerMock, managers.RanListManager) {
+ log := initLog(t)
+ config := configuration.ParseConfiguration()
+
+ rmrMessengerMock := &mocks.RmrMessengerMock{}
+ readerMock := &mocks.RnibReaderMock{}
+
+ writerMock := &mocks.RnibWriterMock{}
+
+ rnibDataService := services.NewRnibDataService(log, config, readerMock, writerMock)
+ rmrSender := getRmrSender(rmrMessengerMock, log)
+ e2tInstancesManager := &mocks.E2TInstancesManagerMock{}
+ httpClientMock := &mocks.HttpClientMock{}
+ rmClient := clients.NewRoutingManagerClient(log, config, httpClientMock)
+ ranListManager := managers.NewRanListManager(log, rnibDataService)
+ ranAlarmService := &mocks.RanAlarmServiceMock{}
+ ranConnectStatusChangeManager := managers.NewRanConnectStatusChangeManager(log, rnibDataService, ranListManager, ranAlarmService)
+ nodebValidator := managers.NewNodebValidator()
+ updateEnbManager := managers.NewUpdateEnbManager(log, rnibDataService, nodebValidator)
+ updateGnbManager := managers.NewUpdateGnbManager(log, rnibDataService, nodebValidator)
+ handlerProvider := httpmsghandlerprovider.NewIncomingRequestHandlerProvider(log, rmrSender, config, rnibDataService, e2tInstancesManager, rmClient, ranConnectStatusChangeManager, nodebValidator, updateEnbManager, updateGnbManager, ranListManager)
+ controller := NewNodebController(log, handlerProvider)
+ return controller, readerMock, writerMock, rmrMessengerMock, e2tInstancesManager, ranListManager
+}
+
+func setupDeleteEnbControllerTest(t *testing.T, preAddNbIdentity bool) (*NodebController, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *entities.NbIdentity) {
+ log := initLog(t)
+ config := configuration.ParseConfiguration()
+