From: is005q Date: Mon, 9 Dec 2019 08:01:51 +0000 (+0200) Subject: Minor changes - RnibReader UTs..... X-Git-Tag: common/v1.0.27~2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=22c939f231dc0c23768f444330e2de8393e0aba8;p=ric-plt%2Fnodeb-rnib.git Minor changes - RnibReader UTs..... Change-Id: I9cde268fbbf2e6646efeba072dfa4381ff2636a6 Signed-off-by: is005q --- diff --git a/reader/rNibReader_test.go b/reader/rNibReader_test.go index 32e3503..66205f8 100644 --- a/reader/rNibReader_test.go +++ b/reader/rNibReader_test.go @@ -1033,16 +1033,6 @@ func TestGetE2TInstanceSuccess(t *testing.T) { assert.Equal(t, e2tInstance, res) } -func TestUnmarshal(t *testing.T) { - e2tInstance := generateE2tInstance("10.0.2.15:5555") - marshaled, _ := json.Marshal(e2tInstance) - m := map[string]interface{}{ - "whatever": string(marshaled), - } - var entity *entities.E2TInstance - _ = json.Unmarshal([]byte(m["whatever"].(string)), entity) -} - func TestGetE2TInstanceEmptyAddressFailure(t *testing.T) { w, _ := initSdlInstanceMock() res, err := w.GetE2TInstance("") @@ -1076,6 +1066,18 @@ func generateE2tInstance(address string) *entities.E2TInstance { return e2tInstance } +func TestGetE2TAddressesSdlError(t *testing.T) { + w, sdlInstanceMock := initSdlInstanceMock() + + expectedErr := errors.New("expected error") + var ret map[string]interface{} + sdlInstanceMock.On("Get", []string{E2TAddressesKey}).Return(ret, expectedErr) + + res, rNibErr := w.GetE2TAddresses() + assert.NotNil(t, rNibErr) + assert.Nil(t, res) +} + func TestGetE2TAddressesSuccess(t *testing.T) { address := "10.10.2.15:9800" w, sdlInstanceMock := initSdlInstanceMock() @@ -1165,17 +1167,6 @@ func TestGetE2TInstancesEmptyData(t *testing.T) { assert.IsType(t, &common.ResourceNotFoundError{}, err) } -func TestGetE2TInfoListSdlError(t *testing.T) { - w, sdlInstanceMock := initSdlInstanceMock() - - expectedErr := errors.New("expected error") - var ret map[string]interface{} - sdlInstanceMock.On("Get", []string{E2TAddressesKey}).Return(ret, expectedErr) - - res, rNibErr := w.GetE2TAddresses() - assert.NotNil(t, rNibErr) - assert.Nil(t, res) -} //integration tests //