[RIC-431] Remove handling of UNKNOWN node types from GetNodebIdsList 02/4402/1 common/v1.0.46 entities/v1.0.46 reader/v1.0.46 v1.0.46
authoridanshal <idan.shalom@intl.att.com>
Thu, 16 Jul 2020 15:01:18 +0000 (15:01 +0000)
committeridanshal <idan.shalom@intl.att.com>
Thu, 16 Jul 2020 15:01:30 +0000 (15:01 +0000)
Change-Id: I4f5747884c9c6646a0763afb6885c11564495937
Signed-off-by: idanshal <idan.shalom@intl.att.com>
reader/go.mod
reader/rNibReader.go
reader/rNibReader_test.go

index 9160ac4..87dfb21 100644 (file)
@@ -3,8 +3,8 @@ module gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader
 go 1.12
 
 require (
-       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.45
-       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.45
+       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.46
+       gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.46
        github.com/golang/protobuf v1.4.2
        github.com/google/go-cmp v0.4.1 // indirect
        github.com/pkg/errors v0.8.1
index 19feefa..a83c033 100644 (file)
@@ -178,12 +178,7 @@ func (w *rNibReaderInstance) GetListNodebIds() ([]*entities.NbIdentity, error) {
        if err != nil {
                return nil, common.NewInternalError(err)
        }
-       dataUnknown, err := w.sdl.GetMembers(entities.Node_UNKNOWN.String())
-       if err != nil {
-               return nil, common.NewInternalError(err)
-       }
        allIds := append(dataEnb, dataGnb...)
-       allIds = append(allIds, dataUnknown...)
        data, rnibErr := w.unmarshalIdentityList(allIds)
        return data, rnibErr
 }
index 73ff176..4004be5 100644 (file)
@@ -369,21 +369,13 @@ func TestGetListNodesIdsSuccess(t *testing.T) {
                t.Errorf("#rNibReader_test.TestGetListNodesIdsSuccess - Failed to marshal nodeb identity entity. Error: %v", err)
        }
 
-       name2 := "name2"
-       nbIdentity2 := &entities.NbIdentity{InventoryName: name2}
-       data2, err := proto.Marshal(nbIdentity2)
-       if err != nil {
-               t.Errorf("#rNibReader_test.TestGetListNodesIdsSuccess - Failed to marshal nodeb identity entity. Error: %v", err)
-       }
-
        sdlInstanceMock.On("GetMembers", entities.Node_GNB.String()).Return([]string{string(data)}, nilError)
        sdlInstanceMock.On("GetMembers", entities.Node_ENB.String()).Return([]string{string(data1)}, nilError)
-       sdlInstanceMock.On("GetMembers", entities.Node_UNKNOWN.String()).Return([]string{string(data2)}, nilError)
 
        ids, er := w.GetListNodebIds()
        assert.Nil(t, er)
        assert.NotNil(t, ids)
-       assert.Len(t, ids, 3)
+       assert.Len(t, ids, 2)
 }
 
 func TestGetListEnbIdsUnmarshalFailure(t *testing.T) {