X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fproviders%2Fnotification_handler_provider_test.go;h=974de025b811944a7398987ded2c230dfc9aa24d;hb=549944ecfb9e75ed4a03dd6d10e4160b89f26ca8;hp=ecdd74483333c1dae15f4412f5773e1326d8355a;hpb=07ef76dd471a0892a893c90e0ab06713aee34be1;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/providers/notification_handler_provider_test.go b/E2Manager/providers/notification_handler_provider_test.go index ecdd744..974de02 100644 --- a/E2Manager/providers/notification_handler_provider_test.go +++ b/E2Manager/providers/notification_handler_provider_test.go @@ -34,7 +34,7 @@ import ( */ func TestGetNotificationHandlerSuccess(t *testing.T) { - readerMock :=&mocks.RnibReaderMock{} + readerMock := &mocks.RnibReaderMock{} rnibReaderProvider := func() reader.RNibReader { return readerMock } @@ -48,10 +48,10 @@ func TestGetNotificationHandlerSuccess(t *testing.T) { }{ {rmrCgo.RIC_X2_SETUP_RESP /*successful x2 setup response*/, handlers.X2SetupResponseNotificationHandler{}}, {rmrCgo.RIC_X2_SETUP_FAILURE /*unsuccessful x2 setup response*/, handlers.X2SetupFailureResponseNotificationHandler{}}, - {rmrCgo.RIC_ENDC_X2_SETUP_RESP /*successful en-dc x2 setup response*/,handlers.EndcX2SetupResponseNotificationHandler{}}, - {rmrCgo.RIC_ENDC_X2_SETUP_FAILURE /*unsuccessful en-dc x2 setup response*/,handlers.EndcX2SetupFailureResponseNotificationHandler{}}, + {rmrCgo.RIC_ENDC_X2_SETUP_RESP /*successful en-dc x2 setup response*/, handlers.EndcX2SetupResponseNotificationHandler{}}, + {rmrCgo.RIC_ENDC_X2_SETUP_FAILURE /*unsuccessful en-dc x2 setup response*/, handlers.EndcX2SetupFailureResponseNotificationHandler{}}, {rmrCgo.RIC_SCTP_CONNECTION_FAILURE /*sctp errors*/, handlers.NewRanLostConnectionHandler(rnibReaderProvider, rnibWriterProvider)}, - {rmrCgo.RIC_ENB_LOAD_INFORMATION, handlers.RicEnbLoadInformationNotificationHandler{}}, + {rmrCgo.RIC_ENB_LOAD_INFORMATION, handlers.NewEnbLoadInformationNotificationHandler(rnibWriterProvider)}, {rmrCgo.RIC_ENB_CONF_UPDATE, handlers.X2EnbConfigurationUpdateHandler{}}, {rmrCgo.RIC_ENDC_CONF_UPDATE, handlers.EndcConfigurationUpdateHandler{}}, } @@ -66,7 +66,7 @@ func TestGetNotificationHandlerSuccess(t *testing.T) { //Note struct is empty, so it will match any other empty struct. // https://golang.org/ref/spec#Comparison_operators: Struct values are comparable if all their fields are comparable. Two struct values are equal if their corresponding non-blank fields are equal. if /*handler != tc.handler &&*/ strings.Compare(fmt.Sprintf("%T", handler), fmt.Sprintf("%T", tc.handler)) != 0 { - t.Errorf("want: handler %T for message type %d, got: %T", tc.handler,tc.msgType, handler) + t.Errorf("want: handler %T for message type %d, got: %T", tc.handler, tc.msgType, handler) } }) } @@ -84,7 +84,7 @@ func TestGetNotificationHandlerFailure(t *testing.T) { {9999 /*unknown*/, "notification handler not found"}, } for _, tc := range testCases { - readerMock :=&mocks.RnibReaderMock{} + readerMock := &mocks.RnibReaderMock{} rnibReaderProvider := func() reader.RNibReader { return readerMock }