X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fsdl_restSubsDb_test.go;h=5e1db6025b4e786e5ba9d96b6c0de2d65ec0a009;hb=84662c4f3e2273152fc849f74880108b6346bcad;hp=273a15e1fb5053b70e6ddd346cb31662b8213893;hpb=f0bb66c95fa3f03ae956cc719cc776ed2f2f3bd4;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/sdl_restSubsDb_test.go b/pkg/control/sdl_restSubsDb_test.go index 273a15e..5e1db60 100644 --- a/pkg/control/sdl_restSubsDb_test.go +++ b/pkg/control/sdl_restSubsDb_test.go @@ -89,6 +89,7 @@ func CreateRESTSubscription(t *testing.T) *RESTSubscription { t.Log("TEST: Creating REST subscription") restSubscription := &RESTSubscription{} + restSubscription.xAppServiceName = "localhost" restSubscription.xAppRmrEndPoint = "localhost:13560" restSubscription.Meid = "RAN_NAME_1" restSubscription.SubReqOngoing = true @@ -100,6 +101,7 @@ func CreateRESTSubscription(t *testing.T) *RESTSubscription { func PrintRESTSubscriptionData(t *testing.T, restSubs *RESTSubscription) { t.Log("TEST: RESTSubscription data") + t.Logf("TEST: restSubs.xAppServiceName = %v", restSubs.xAppServiceName) t.Logf("TEST: restSubs.xAppRmrEndPoint = %v", restSubs.xAppRmrEndPoint) t.Logf("TEST: restSubs.Meid = %v", restSubs.Meid) t.Logf("TEST: restSubs.InstanceIds = %v", restSubs.InstanceIds) @@ -120,6 +122,17 @@ func TestWriteRESTSubscriptionToSdl(t *testing.T) { t.Errorf("TEST: %s", err.Error()) } restSubsDbMock.AddRestSubIdsInDb(restSubId) + verifyRESTKeyCount(t, 1) +} + +func verifyRESTKeyCount(t *testing.T, expectedCount int) { + + count, err := mainCtrl.c.GetRESTKeyCount() + if err != nil { + t.Errorf("TEST: %s", err.Error()) + } else { + assert.Equal(t, expectedCount, count) + } } func TestReadRESTSubscriptionFromSdl(t *testing.T) {