Fix for Submgr crash added
[ric-plt/submgr.git] / pkg / control / ut_ctrl_submgr_test.go
index 9ec0e84..66df576 100644 (file)
@@ -55,8 +55,10 @@ func createSubmgrControl(srcId teststub.RmrSrcId, rtgSvc teststub.RmrRtgSvc) *te
        mainCtrl = &testingSubmgrControl{}
        mainCtrl.RmrControl.Init("SUBMGRCTL", srcId, rtgSvc)
        mainCtrl.c = NewControl()
+       mainCtrl.c.UTTesting = true
        xapp.Logger.Debug("Replacing real db with test db")
-       mainCtrl.c.db = CreateMock() // This overrides real database for testing
+       mainCtrl.c.e2SubsDb = CreateMock()             // This overrides real E2 Subscription database for testing
+       mainCtrl.c.restSubsDb = CreateRestSubsDbMock() // This overrides real REST Subscription database for testing
        xapp.SetReadyCB(mainCtrl.ReadyCB, nil)
        go xapp.RunWithParams(mainCtrl.c, false)
        mainCtrl.WaitCB()
@@ -69,6 +71,7 @@ func (mc *testingSubmgrControl) SimulateRestart(t *testing.T) {
        mainCtrl.c.registry.subIds = nil
        // Initialize subIds slice and subscription map
        mainCtrl.c.registry.Initialize()
+       mainCtrl.c.restDuplicateCtrl.Init()
        // Read subIds and subscriptions from database
        subIds, register, err := mainCtrl.c.ReadAllSubscriptionsFromSdl()
        if err != nil {