Xapp registration/deregistration to RIC

Signed-off-by: wahidw <abdulwahid.w@nokia.com>
Change-Id: I62104203e6f2de9359a2ab184966395f4c758b48
diff --git a/pkg/xapp/xapp_test.go b/pkg/xapp/xapp_test.go
index 04bbbb8..173b57f 100755
--- a/pkg/xapp/xapp_test.go
+++ b/pkg/xapp/xapp_test.go
@@ -20,16 +20,16 @@
 package xapp
 
 import (
+	"bytes"
 	"github.com/gorilla/mux"
 	"github.com/spf13/viper"
+	"github.com/stretchr/testify/assert"
 	"net/http"
 	"net/http/httptest"
-	"github.com/stretchr/testify/assert"
 	"os"
 	"strings"
 	"testing"
 	"time"
-	"bytes"
 )
 
 //var _ = func() bool {
@@ -118,8 +118,8 @@
 		params.Payload = []byte{1, 2, 3, 4, 5, 6}
 		params.Meid = &RMRMeid{PlmnID: "1234", EnbID: "7788", RanName: "RanName-1234"}
 		params.Xid = "TestXID"
-		
-		if i % 2 == 0 {
+
+		if i%2 == 0 {
 			Rmr.SendMsg(params)
 		} else {
 			Rmr.SendWithRetry(params, false, 1)
@@ -332,11 +332,11 @@
 
 func TestConfigAccess(t *testing.T) {
 	Logger.Info("CASE: AddConfigChangeListener")
-	
-	assert.Equal(t,  Config.GetString("name"), "xapp")
-	assert.Equal(t,  Config.GetInt("controls.logger.level"), 3)
-	assert.Equal(t,  Config.GetUint32("controls.logger.level"), uint32(3))
-	assert.Equal(t,  Config.GetBool("controls.waitForSdl"), false)
+
+	assert.Equal(t, Config.GetString("name"), "xapp")
+	assert.Equal(t, Config.GetInt("controls.logger.level"), 3)
+	assert.Equal(t, Config.GetUint32("controls.logger.level"), uint32(3))
+	assert.Equal(t, Config.GetBool("controls.waitForSdl"), false)
 	Config.Get("controls")
 	Config.GetStringSlice("messaging.ports")
 	Config.GetStringMap("messaging.ports")
@@ -354,7 +354,7 @@
 }
 
 func TestNewRMRClient(t *testing.T) {
-	c := map[string]interface{} {"protPort": "tcp:4560"}
+	c := map[string]interface{}{"protPort": "tcp:4560"}
 	viper.Set("rmr", c)
 	assert.NotNil(t, NewRMRClient(), "NewRMRClient failed")
 
@@ -423,6 +423,23 @@
 	executeRequest(req, handleFunc)
 }
 
+func TestappconfigHandler(t *testing.T) {
+	Logger.Error("CASE: TestappconfigHandler")
+	req, _ := http.NewRequest("POST", "/ric/v1/config", bytes.NewBuffer([]byte{}))
+	handleFunc := http.HandlerFunc(appconfigHandler)
+	executeRequest(req, handleFunc)
+}
+
+func TestSendRegistermsg(t *testing.T) {
+	Logger.Error("CASE: TestSendRegistermsg")
+	SendRegistermsg()
+}
+
+func TestSendDeregistermsg(t *testing.T) {
+	Logger.Error("CASE: TestSendDeregistermsg")
+	SendDeregistermsg()
+}
+
 func TestMisc(t *testing.T) {
 	Logger.Info("CASE: TestMisc")