X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fnbi%2Fhttpgetter_test.go;h=5c7082a6f23c6eb26be98934506de3ef80ef37c4;hb=refs%2Fchanges%2F53%2F1153%2F2;hp=a6cbbf77a91c349d279e9db64adc18b601338d11;hpb=92162653c9741f2417d1a36ec1c211d6863d0a68;p=ric-plt%2Frtmgr.git diff --git a/pkg/nbi/httpgetter_test.go b/pkg/nbi/httpgetter_test.go index a6cbbf7..5c7082a 100644 --- a/pkg/nbi/httpgetter_test.go +++ b/pkg/nbi/httpgetter_test.go @@ -33,21 +33,19 @@ import ( ) var ( - XMURL string = "http://127.0.0.1:3000/ric/v1/xapps" + XMURL = "http://127.0.0.1:3000/ric/v1/xapps" ) - func TestFetchXappListInvalidData(t *testing.T) { var httpGetter = NewHttpGetter() - _, err := httpGetter.FetchAllXapps(XMURL) + _, err := httpGetter.FetchAllXApps(XMURL) if err == nil { - t.Error("No XApp data received: "+err.Error()) + t.Error("No XApp data received: " + err.Error()) } } - func TestFetchXappListWithInvalidData(t *testing.T) { - var expected int = 0 + var expected = 0 rtmgr.SetLogLevel("debug") b := []byte(`{"ID":"deadbeef1234567890", "Version":0, "EventType":"all"}`) l, err := net.Listen("tcp", "127.0.0.1:3000") @@ -70,7 +68,7 @@ func TestFetchXappListWithInvalidData(t *testing.T) { ts.Start() defer ts.Close() var httpGetter = NewHttpGetter() - xapplist, err := httpGetter.FetchAllXapps(XMURL) + xapplist, err := httpGetter.FetchAllXApps(XMURL) if err == nil { t.Error("Error occured: " + err.Error()) } else { @@ -81,8 +79,8 @@ func TestFetchXappListWithInvalidData(t *testing.T) { } } -func TestFetchAllXappsWithValidData(t *testing.T) { - var expected int = 1 +func TestFetchAllXAppsWithValidData(t *testing.T) { + var expected = 1 b := []byte(`[ { "name":"xapp-01","status":"unknown","version":"1.2.3", @@ -118,7 +116,7 @@ func TestFetchAllXappsWithValidData(t *testing.T) { ts.Start() defer ts.Close() var httpGetter = NewHttpGetter() - xapplist, err := httpGetter.FetchAllXapps(XMURL) + xapplist, err := httpGetter.FetchAllXApps(XMURL) if err != nil { t.Error("Error occured: " + err.Error()) } else { @@ -127,4 +125,3 @@ func TestFetchAllXappsWithValidData(t *testing.T) { } } } -