[RIC-397] rename method to UpdateNodebInfoOnConnectionStatusInversion
[ric-plt/e2mgr.git] / E2Manager / rNibWriter / rNibWriter_test.go
index 7875b88..07efb66 100644 (file)
@@ -742,7 +742,7 @@ func TestRemoveE2TInstanceEmptyAddressFailure(t *testing.T) {
        sdlInstanceMock.AssertExpectations(t)
 }
 
-func TestUpdateNodebConnectivityStateSuccess(t *testing.T) {
+func TestUpdateNodebInfoOnConnectionStatusInversionSuccess(t *testing.T) {
        inventoryName := "name"
        plmnId := "02f829"
        nbId := "4a952a0a"
@@ -752,7 +752,7 @@ func TestUpdateNodebConnectivityStateSuccess(t *testing.T) {
        nodebInfo := generateNodebInfo(inventoryName, entities.Node_ENB, plmnId, nbId)
        data, err := proto.Marshal(nodebInfo)
        if err != nil {
-               t.Errorf("#rNibWriter_test.TestUpdateNodebConnectivityStateSuccess - Failed to marshal NodeB entity. Error: %v", err)
+               t.Errorf("#rNibWriter_test.TestUpdateNodebInfoOnConnectionStatusInversionSuccess - Failed to marshal NodeB entity. Error: %v", err)
        }
        var e error
        var setExpected []interface{}
@@ -764,11 +764,11 @@ func TestUpdateNodebConnectivityStateSuccess(t *testing.T) {
 
        sdlInstanceMock.On("SetAndPublish", []string{channelName, eventName}, []interface{}{setExpected}).Return(e)
 
-       rNibErr := w.UpdateNodebConnectivityState(nodebInfo, channelName, eventName)
+       rNibErr := w.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, channelName, eventName)
        assert.Nil(t, rNibErr)
 }
 
-func TestUpdateNodebConnectivityStateMissingInventoryNameFailure(t *testing.T) {
+func TestUpdateNodebInfoOnConnectionStatusInversionMissingInventoryNameFailure(t *testing.T) {
        inventoryName := "name"
        plmnId := "02f829"
        nbId := "4a952a0a"
@@ -778,7 +778,7 @@ func TestUpdateNodebConnectivityStateMissingInventoryNameFailure(t *testing.T) {
        nodebInfo := &entities.NodebInfo{}
        data, err := proto.Marshal(nodebInfo)
        if err != nil {
-               t.Errorf("#rNibWriter_test.TestUpdateNodebConnectivityStateMissingInventoryNameFailure - Failed to marshal NodeB entity. Error: %v", err)
+               t.Errorf("#rNibWriter_test.TestUpdateNodebInfoOnConnectionStatusInversionMissingInventoryNameFailure - Failed to marshal NodeB entity. Error: %v", err)
        }
        var e error
        var setExpected []interface{}
@@ -790,13 +790,13 @@ func TestUpdateNodebConnectivityStateMissingInventoryNameFailure(t *testing.T) {
 
        sdlInstanceMock.On("SetAndPublish", []string{channelName, eventName}, []interface{}{setExpected}).Return(e)
 
-       rNibErr := w.UpdateNodebConnectivityState(nodebInfo, channelName, eventName)
+       rNibErr := w.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, channelName, eventName)
 
        assert.NotNil(t, rNibErr)
        assert.IsType(t, &common.ValidationError{}, rNibErr)
 }
 
-func TestUpdateNodebConnectivityStateMissingGlobalNbId(t *testing.T) {
+func TestUpdateNodebInfoOnConnectionStatusInversionMissingGlobalNbId(t *testing.T) {
        inventoryName := "name"
        channelName := "RAN_CONNECT_STATE_CHANGE"
        eventName := inventoryName + "_" + "CONNECTED"
@@ -805,7 +805,7 @@ func TestUpdateNodebConnectivityStateMissingGlobalNbId(t *testing.T) {
        nodebInfo.RanName = inventoryName
        data, err := proto.Marshal(nodebInfo)
        if err != nil {
-               t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal NodeB entity. Error: %v", err)
+               t.Errorf("#rNibWriter_test.TestUpdateNodebInfoOnConnectionStatusInversionMissingInventoryNameFailure - Failed to marshal NodeB entity. Error: %v", err)
        }
        var e error
        var setExpected []interface{}
@@ -814,7 +814,7 @@ func TestUpdateNodebConnectivityStateMissingGlobalNbId(t *testing.T) {
        setExpected = append(setExpected, nodebNameKey, data)
        sdlInstanceMock.On("SetAndPublish", []string{channelName, eventName}, []interface{}{setExpected}).Return(e)
 
-       rNibErr := w.UpdateNodebConnectivityState(nodebInfo, channelName, eventName)
+       rNibErr := w.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, channelName, eventName)
 
        assert.Nil(t, rNibErr)
 }