RIC-79 intial implementation to fetch subscriptions via rest

Change-Id: Iff2915998c130cb93fa3b1767b2499d8ef3713e5
Signed-off-by: Juha Hyttinen <juha.hyttinen@nokia.com>
diff --git a/pkg/control/ut_messaging_test.go b/pkg/control/ut_messaging_test.go
index 53d8a85..c0d76e2 100644
--- a/pkg/control/ut_messaging_test.go
+++ b/pkg/control/ut_messaging_test.go
@@ -22,6 +22,8 @@
 import (
 	"gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
 	"gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststube2ap"
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+	"github.com/stretchr/testify/assert"
 	"testing"
 )
 
@@ -102,20 +104,22 @@
 func TestSubReqAndSubDelOk(t *testing.T) {
 	CaseBegin("TestSubReqAndSubDelOk")
 
-	waiter := rtmgrHttp.AllocNextEvent(true)
 	cretrans := xappConn1.SendSubsReq(t, nil, nil)
-	waiter.WaitResult(t)
 
 	crereq, cremsg := e2termConn1.RecvSubsReq(t)
 	e2termConn1.SendSubsResp(t, crereq, cremsg)
 	e2SubsId := xappConn1.RecvSubsResp(t, cretrans)
+
+	resp, _ := xapp.Subscription.QuerySubscriptions()
+	assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId))
+	assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
+	assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560"})
+
 	deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId)
 	delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
 
-	waiter = rtmgrHttp.AllocNextEvent(true)
 	e2termConn1.SendSubsDelResp(t, delreq, delmsg)
 	xappConn1.RecvSubsDelResp(t, deltrans)
-	waiter.WaitResult(t)
 
 	//Wait that subs is cleaned
 	mainCtrl.wait_subs_clean(t, e2SubsId, 10)
@@ -937,6 +941,11 @@
 	//e2termConn1.SendSubsResp(t, crereq2, cremsg2)
 	e2SubsId2 := xappConn2.RecvSubsResp(t, cretrans2)
 
+	resp, _ := xapp.Subscription.QuerySubscriptions()
+	assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId1))
+	assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
+	assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560", "localhost:13660"})
+
 	//Del1
 	deltrans1 := xappConn1.SendSubsDelReq(t, nil, e2SubsId1)
 	//e2termConn1.RecvSubsDelReq(t)