X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fhandlers%2Frmrmsghandlers%2Fenb_load_information_notification_handler_test.go;h=743083b1975895aba62771d9671ef7755a3c3853;hb=7000880c4031e607a2fe36046fd097f486476a84;hp=c507ec3152f5456250b0c8ddacaeb2a927dbd72f;hpb=1ec13d4076e7c7abefac6176462c1fee31229213;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/handlers/rmrmsghandlers/enb_load_information_notification_handler_test.go b/E2Manager/handlers/rmrmsghandlers/enb_load_information_notification_handler_test.go index c507ec3..743083b 100644 --- a/E2Manager/handlers/rmrmsghandlers/enb_load_information_notification_handler_test.go +++ b/E2Manager/handlers/rmrmsghandlers/enb_load_information_notification_handler_test.go @@ -13,27 +13,28 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// + +// This source code is part of the near-RT RIC (RAN Intelligent Controller) +// platform project (RICP). + package rmrmsghandlers -import ( - "e2mgr/logger" +/*import ( "e2mgr/models" - "e2mgr/sessions" "fmt" "time" ) const ( FullUperPdu string = "004c07080004001980da0100075bde017c148003d5a8205000017c180003d5a875555403331420000012883a0003547400cd20002801ea16007c1f07c1f107c1f0781e007c80800031a02c000c88199040a00352083669190000d8908020000be0c4001ead4016e007ab50100002f8320067ab5005b8c1ead5070190c00001d637805f220000f56a081400005f020000f56a1d555400ccc508002801ea16007c1f07c1f107c1f0781e007c80800031a02c000c88199040a00352083669190000d8908020000be044001ead4016e007ab50100002f8120067ab5005b8c1ead5070190c00000" - FullAperPdu string = "" // TODO: populate and use it + FullAperPdu string = "" // TODO: populate and use it BasicUperPdu string = "004898000400190d0000074200017c148003d5a80000" BasicAperPdu string = "" // TODO: populate and use it GarbagePdu string = "12312312" ) -func createNotificationRequest(ranName string, transactionId string, packedPdu string) (*models.NotificationRequest, error) { +func createNotificationRequest(ranName string, transactionId []byte, packedPdu string) (*models.NotificationRequest, error) { var packedByteSlice []byte _, err := fmt.Sscanf(packedPdu, "%x", &packedByteSlice) @@ -42,19 +43,19 @@ func createNotificationRequest(ranName string, transactionId string, packedPdu s return nil, err } - return models.NewNotificationRequest(ranName, packedByteSlice, time.Now(), transactionId), nil + return models.NewNotificationRequest(ranName, packedByteSlice, time.Now(), transactionId, nil), nil } -func createNotificationRequestAndHandle(log *logger.Logger, ranName string, transactionId string, loadInformationHandler EnbLoadInformationNotificationHandler, pdu string) error { +func createNotificationRequestAndHandle(ranName string, transactionId []byte, loadInformationHandler EnbLoadInformationNotificationHandler, pdu string) error { notificationRequest, err := createNotificationRequest(ranName, transactionId, pdu) if err != nil { return err } - loadInformationHandler.Handle(log, sessions.E2Sessions{}, notificationRequest, nil) + loadInformationHandler.Handle(notificationRequest) return nil -} +}*/ //func TestLoadInformationHandlerSuccess(t *testing.T) { // log, err := logger.InitLogger(logger.InfoLevel) @@ -77,7 +78,7 @@ func createNotificationRequestAndHandle(log *logger.Logger, ranName string, tran // var packedExampleByteSlice []byte // _, err = fmt.Sscanf(FullUperPdu, "%x", &packedExampleByteSlice) // notificationRequest := models.NewNotificationRequest(inventoryName, packedExampleByteSlice, time.Now(), " 881828026419") -// loadInformationHandler.Handle(log, sessions.E2Sessions{}, notificationRequest, nil) +// loadInformationHandler.Handle(log, notificationRequest) // // writerMock.AssertNumberOfCalls(t, "SaveRanLoadInformation", 1) //} @@ -103,7 +104,7 @@ func createNotificationRequestAndHandle(log *logger.Logger, ranName string, tran // var packedExampleByteSlice []byte // _, err = fmt.Sscanf(GarbagePdu, "%x", &packedExampleByteSlice) // notificationRequest := models.NewNotificationRequest(inventoryName, packedExampleByteSlice, time.Now(), " 881828026419") -// loadInformationHandler.Handle(log, sessions.E2Sessions{}, notificationRequest, nil) +// loadInformationHandler.Handle(log, notificationRequest) // // writerMock.AssertNumberOfCalls(t, "SaveRanLoadInformation", 0) //} @@ -121,13 +122,13 @@ func createNotificationRequestAndHandle(log *logger.Logger, ranName string, tran // defer reader.Close() // loadInformationHandler := NewEnbLoadInformationNotificationHandler(rNibWriter.GetRNibWriter) // -// err = createNotificationRequestAndHandle(log, "ranName", " 881828026419", loadInformationHandler, FullUperPdu) +// err = createNotificationRequestAndHandle("ranName", " 881828026419", loadInformationHandler, FullUperPdu) // // if err != nil { // t.Errorf("#setup_request_handler_test.TestLoadInformationHandlerOverrideSuccess - failed creating NotificationRequest, error: %v", err) // } // -// err = createNotificationRequestAndHandle(log, "ranName", " 881828026419", loadInformationHandler, BasicUperPdu) +// err = createNotificationRequestAndHandle("ranName", " 881828026419", loadInformationHandler, BasicUperPdu) // // if err != nil { // t.Errorf("#setup_request_handler_test.TestLoadInformationHandlerOverrideSuccess - failed creating NotificationRequest, error: %v", err)