+ expectedKeys := []string{}
+ cell1Key := fmt.Sprintf("CELL:%s", nodebInfo.GetEnb().ServedCells[0].CellId)
+ cell1PciKey := fmt.Sprintf("PCI:%s:%02x", inventoryName, nodebInfo.GetEnb().ServedCells[0].Pci)
+ cell2Key := fmt.Sprintf("CELL:%s", nodebInfo.GetEnb().ServedCells[1].CellId)
+ cell2PciKey := fmt.Sprintf("PCI:%s:%02x", inventoryName, nodebInfo.GetEnb().ServedCells[1].Pci)
+ nodebNameKey := fmt.Sprintf("RAN:%s", inventoryName)
+ nodebIdKey := fmt.Sprintf("ENB:%s:%s", plmnId, nbId)
+ expectedKeys = append(expectedKeys, cell1Key, cell1PciKey, cell2Key, cell2PciKey, nodebNameKey, nodebIdKey)
+ sdlInstanceMock.On("RemoveAndPublish", []string{channelName, eventName}, expectedKeys).Return(errors.New("for test"))
+
+ rNibErr := w.RemoveEnb(nodebInfo)
+ assert.NotNil(t, rNibErr)
+ sdlInstanceMock.AssertExpectations(t)
+}
+
+func TestRemoveNbIdentitySuccess(t *testing.T) {
+ w, sdlInstanceMock := initSdlInstanceMock(namespace)
+ nbIdentity := &entities.NbIdentity{InventoryName: "ran1", ConnectionStatus: entities.ConnectionStatus_DISCONNECTED, GlobalNbId: &entities.GlobalNbId{PlmnId: "plmnId1", NbId: "nbId1"}}