X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fnbi%2Fhttprestful_test.go;h=1de62935c388bdbf85df8b0189d5601ea3dadbfa;hb=930db799fe886da7b2c80f89ed3f67c0433c4ed7;hp=aece2b0c67ec8c31f3f7d1d280ab8c476b35c6fe;hpb=1433f4d8e1022cdc6ffd505a9b18130c66f1101d;p=ric-plt%2Frtmgr.git diff --git a/pkg/nbi/httprestful_test.go b/pkg/nbi/httprestful_test.go index aece2b0..1de6293 100644 --- a/pkg/nbi/httprestful_test.go +++ b/pkg/nbi/httprestful_test.go @@ -576,6 +576,7 @@ func createMockSubmgrWithData(url string, t []byte) *httptest.Server { return ts } + func createMockPlatformComponents() { var filename = "config.json" file, _ := json.MarshalIndent(stub.ValidPlatformComponents, "", "") @@ -684,6 +685,29 @@ func TestRetrieveStartupData(t *testing.T) { os.Remove("config.json") } +func TestRetrieveStartupDatawithInvalidE2MUrl(t *testing.T) { + ts := createMockAppmgrWithData("127.0.0.1:3000", BasicXAppLists, SubscriptionResp, nil) + ts.Start() + defer ts.Close() + + ts1 := createMockAppmgrWithData("127.0.0.1:8085", nil, nil, E2TListResp) + ts1.Start() + defer ts1.Close() + + ts2 := createMockSubmgrWithData("127.0.0.1:8089", SubscriptionList) + ts2.Start() + defer ts2.Close() + + + sdlEngine, _ := sdl.GetSdl("file") + var httpRestful, _ = GetNbi("httpRESTful") + createMockPlatformComponents() + + E2MURL1 := "http://127.0.0.1:8080/ric/v1/e2t/list" + httpRestful.(*HttpRestful).RetrieveStartupData(XMURL, "httpgetter", "rt.json", "config.json", E2MURL1, sdlEngine) + os.Remove("rt.json") + os.Remove("config.json") +} func TestRetrieveStartupDataWithInvalidSubResp(t *testing.T) { ts := createMockAppmgrWithData("127.0.0.1:3000", BasicXAppLists, InvalidSubResp, nil) ts.Start() @@ -742,6 +766,10 @@ func TestDumpDebugdata(t *testing.T) { _, _ = DumpDebugData() } +func TestDumpDebugdata1(t *testing.T) { + _, _ = DumpDebugData() +} + func TestManagerRequest(t *testing.T) { var params xapp.RMRParams var rmrmeid xapp.RMRMeid @@ -756,6 +784,7 @@ func TestManagerRequest(t *testing.T) { params.Meid = &rmrmeid params.Src = "sender" params.PayloadLen = 4 + c.handleUpdateToRoutingManagerRequest(¶ms) }