X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fhandlers%2Frmrmsghandlers%2Fsetup_response_notification_handler_test.go;h=b401cbb55a3cbe05d8f4fb8f576fb4184818edb0;hb=086691323016a409a53df7ca6f52339641a19063;hp=d52181c3de8fb3c554c5bc3c86c732537dc55c41;hpb=b3805a9d29e2c7f6f14e3fedfa1ba504f734eea9;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/handlers/rmrmsghandlers/setup_response_notification_handler_test.go b/E2Manager/handlers/rmrmsghandlers/setup_response_notification_handler_test.go index d52181c..b401cbb 100644 --- a/E2Manager/handlers/rmrmsghandlers/setup_response_notification_handler_test.go +++ b/E2Manager/handlers/rmrmsghandlers/setup_response_notification_handler_test.go @@ -143,14 +143,13 @@ func executeHandleSetupSuccessResponse(t *testing.T, tc setupSuccessResponseTest nodebInfo := &entities.NodebInfo{ ConnectionStatus: entities.ConnectionStatus_CONNECTING, - ConnectionAttempts: 1, RanName: RanName, Ip: "10.0.2.2", Port: 1231, } testContext.readerMock.On("GetNodeb", RanName).Return(nodebInfo, rnibErr) - testContext.writerMock.On("SaveNodeb", mock.Anything, mock.Anything).Return(tc.saveNodebMockError) + testContext.writerMock.On("SaveNodeb", mock.Anything).Return(tc.saveNodebMockError) testContext.rmrMessengerMock.On("SendMsg", tc.statusChangeMbuf, true).Return(&rmrCgo.MBuf{}, tc.sendMsgError) handler.Handle(¬ificationRequest) @@ -181,14 +180,13 @@ func executeHandleSetupFailureResponse(t *testing.T, tc setupFailureResponseTest nodebInfo := &entities.NodebInfo{ ConnectionStatus: entities.ConnectionStatus_CONNECTING, - ConnectionAttempts: 1, RanName: RanName, Ip: "10.0.2.2", Port: 1231, } testContext.readerMock.On("GetNodeb", RanName).Return(nodebInfo, rnibErr) - testContext.writerMock.On("SaveNodeb", mock.Anything, mock.Anything).Return(tc.saveNodebMockError) + testContext.writerMock.On("SaveNodeb", mock.Anything).Return(tc.saveNodebMockError) handler.Handle(¬ificationRequest) return testContext, nodebInfo @@ -209,9 +207,8 @@ func TestX2SetupResponse(t *testing.T) { testContext, nodebInfo := executeHandleSetupSuccessResponse(t, tc) testContext.readerMock.AssertCalled(t, "GetNodeb", RanName) - testContext.writerMock.AssertCalled(t, "SaveNodeb", mock.Anything, nodebInfo) + testContext.writerMock.AssertCalled(t, "SaveNodeb", nodebInfo) assert.EqualValues(t, entities.ConnectionStatus_CONNECTED, nodebInfo.ConnectionStatus) - assert.EqualValues(t, 0, nodebInfo.ConnectionAttempts) assert.EqualValues(t, entities.Node_ENB, nodebInfo.NodeType) assert.IsType(t, &entities.NodebInfo_Enb{}, nodebInfo.Configuration) @@ -232,9 +229,8 @@ func TestX2SetupFailureResponse(t *testing.T) { testContext, nodebInfo := executeHandleSetupFailureResponse(t, tc) testContext.readerMock.AssertCalled(t, "GetNodeb", RanName) - testContext.writerMock.AssertCalled(t, "SaveNodeb", mock.Anything, nodebInfo) + testContext.writerMock.AssertCalled(t, "SaveNodeb", nodebInfo) assert.EqualValues(t, entities.ConnectionStatus_CONNECTED_SETUP_FAILED, nodebInfo.ConnectionStatus) - assert.EqualValues(t, 0, nodebInfo.ConnectionAttempts) assert.EqualValues(t, entities.Failure_X2_SETUP_FAILURE, nodebInfo.FailureType) assert.NotNil(t, nodebInfo.SetupFailure) testContext.rmrMessengerMock.AssertNotCalled(t, "SendMsg") @@ -255,9 +251,8 @@ func TestEndcSetupResponse(t *testing.T) { testContext, nodebInfo := executeHandleSetupSuccessResponse(t, tc) testContext.readerMock.AssertCalled(t, "GetNodeb", RanName) - testContext.writerMock.AssertCalled(t, "SaveNodeb", mock.Anything, nodebInfo) + testContext.writerMock.AssertCalled(t, "SaveNodeb", nodebInfo) assert.EqualValues(t, entities.ConnectionStatus_CONNECTED, nodebInfo.ConnectionStatus) - assert.EqualValues(t, 0, nodebInfo.ConnectionAttempts) assert.EqualValues(t, entities.Node_GNB, nodebInfo.NodeType) assert.IsType(t, &entities.NodebInfo_Gnb{}, nodebInfo.Configuration) @@ -278,9 +273,8 @@ func TestEndcSetupFailureResponse(t *testing.T) { testContext, nodebInfo := executeHandleSetupFailureResponse(t, tc) testContext.readerMock.AssertCalled(t, "GetNodeb", RanName) - testContext.writerMock.AssertCalled(t, "SaveNodeb", mock.Anything, nodebInfo) + testContext.writerMock.AssertCalled(t, "SaveNodeb", nodebInfo) assert.EqualValues(t, entities.ConnectionStatus_CONNECTED_SETUP_FAILED, nodebInfo.ConnectionStatus) - assert.EqualValues(t, 0, nodebInfo.ConnectionAttempts) assert.EqualValues(t, entities.Failure_ENDC_X2_SETUP_FAILURE, nodebInfo.FailureType) assert.NotNil(t, nodebInfo.SetupFailure) testContext.rmrMessengerMock.AssertNotCalled(t, "SendMsg") @@ -293,7 +287,7 @@ func TestSetupResponseInvalidPayload(t *testing.T) { testContext := NewSetupResponseTestContext(nil) handler := NewSetupResponseNotificationHandler(testContext.logger, testContext.rnibDataService, managers.NewX2SetupResponseManager(converters.NewX2SetupResponseConverter(logger)), testContext.ranStatusChangeManager, rmrCgo.RIC_X2_SETUP_RESP) var rnibErr error - testContext.readerMock.On("GetNodeb", ranName).Return(&entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTING, ConnectionAttempts: 1}, rnibErr) + testContext.readerMock.On("GetNodeb", ranName).Return(&entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTING}, rnibErr) handler.Handle(¬ificationRequest) testContext.readerMock.AssertCalled(t, "GetNodeb", ranName) testContext.writerMock.AssertNotCalled(t, "SaveNodeb") @@ -315,7 +309,7 @@ func TestSetupResponseSaveNodebFailure(t *testing.T) { testContext, nodebInfo := executeHandleSetupSuccessResponse(t, tc) testContext.readerMock.AssertCalled(t, "GetNodeb", RanName) - testContext.writerMock.AssertCalled(t, "SaveNodeb", mock.Anything, nodebInfo) + testContext.writerMock.AssertCalled(t, "SaveNodeb", nodebInfo) testContext.rmrMessengerMock.AssertNotCalled(t, "SendMsg") } @@ -334,9 +328,8 @@ func TestSetupResponseStatusChangeSendFailure(t *testing.T) { testContext, nodebInfo := executeHandleSetupSuccessResponse(t, tc) testContext.readerMock.AssertCalled(t, "GetNodeb", RanName) - testContext.writerMock.AssertCalled(t, "SaveNodeb", mock.Anything, nodebInfo) + testContext.writerMock.AssertCalled(t, "SaveNodeb", nodebInfo) assert.EqualValues(t, entities.ConnectionStatus_CONNECTED, nodebInfo.ConnectionStatus) - assert.EqualValues(t, 0, nodebInfo.ConnectionAttempts) assert.EqualValues(t, entities.Node_ENB, nodebInfo.NodeType) assert.IsType(t, &entities.NodebInfo_Enb{}, nodebInfo.Configuration)