X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fservices%2Frnib_data_service_test.go;h=ddc65408086aef1115e800dac525b4956c4f25c3;hb=refs%2Fchanges%2F16%2F4316%2F1;hp=f6529e38aaf4dd0281ebdce902084283963dff45;hpb=197657e0e814c871b903ef779ad654b13347e430;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/services/rnib_data_service_test.go b/E2Manager/services/rnib_data_service_test.go index f6529e3..ddc6540 100644 --- a/E2Manager/services/rnib_data_service_test.go +++ b/E2Manager/services/rnib_data_service_test.go @@ -33,8 +33,6 @@ import ( "testing" ) -const CHANNEL_NAME = "channel" - func setupRnibDataServiceTest(t *testing.T) (*rNibDataService, *mocks.RnibReaderMock, *mocks.RnibWriterMock) { return setupRnibDataServiceTestWithMaxAttempts(t, 3) } @@ -45,7 +43,7 @@ func setupRnibDataServiceTestWithMaxAttempts(t *testing.T, maxAttempts int) (*rN t.Errorf("#... - failed to initialize logger, error: %s", err) } - config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: maxAttempts, StateChangeMessageChannel: CHANNEL_NAME} + config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: maxAttempts, RnibWriter: configuration.RnibWriterConfig{RanManipulationMessageChannel: "RAN_MANIPULATION", StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}} readerMock := &mocks.RnibReaderMock{} @@ -264,7 +262,7 @@ func TestSuccessfulUpdateNodebInfoOnConnectionStatusInversion(t *testing.T) { event := "event" nodebInfo := &entities.NodebInfo{} - writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, CHANNEL_NAME, event).Return(nil) + writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, "RAN_CONNECTION_STATUS_CHANGE", event).Return(nil) rnibDataService.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, event) writerMock.AssertNumberOfCalls(t, "UpdateNodebInfoOnConnectionStatusInversion", 1) @@ -276,7 +274,7 @@ func TestConnFailureUpdateNodebInfoOnConnectionStatusInversion(t *testing.T) { nodebInfo := &entities.NodebInfo{} mockErr := &common.InternalError{Err: &net.OpError{Err: fmt.Errorf("connection error")}} - writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, CHANNEL_NAME, event).Return(mockErr) + writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, "RAN_CONNECTION_STATUS_CHANGE", event).Return(mockErr) rnibDataService.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, event) writerMock.AssertNumberOfCalls(t, "UpdateNodebInfoOnConnectionStatusInversion", 3)