X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fhandlers%2Fhttpmsghandlers%2Fupdate_nodeb_request_handler_test.go;h=7be5263de5b215959d29d423013b25c39e93d72a;hb=refs%2Ftags%2F6.0.2;hp=ff4b9f8079becbd8dc9fcd5577235af656b170ce;hpb=5830d4db63151dd466533673fd76d842302f0034;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/handlers/httpmsghandlers/update_nodeb_request_handler_test.go b/E2Manager/handlers/httpmsghandlers/update_nodeb_request_handler_test.go index ff4b9f8..7be5263 100644 --- a/E2Manager/handlers/httpmsghandlers/update_nodeb_request_handler_test.go +++ b/E2Manager/handlers/httpmsghandlers/update_nodeb_request_handler_test.go @@ -1,20 +1,38 @@ -// -// Copyright 2019 AT&T Intellectual Property -// Copyright 2019 Nokia -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// 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. +package httpmsghandlers + +import ( + "e2mgr/configuration" + "e2mgr/managers" + "e2mgr/mocks" + "e2mgr/logger" + "e2mgr/models" + "e2mgr/services" + // "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities" + "github.com/stretchr/testify/assert" + "testing" +) + +func setupUpdateNodebRequestHandlerTest(t *testing.T) ( *UpdateNodebRequestHandler, *mocks.RnibReaderMock, *mocks.RnibWriterMock){ + DebugLevel := int8(4) + logger, err := logger.InitLogger(DebugLevel) + if err != nil { + t.Errorf("#... - failed to initialize logger, error: %s", err) + } + config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3} + readerMock := &mocks.RnibReaderMock{} + writerMock := &mocks.RnibWriterMock{} + rnibDataService := services.NewRnibDataService(logger, config, readerMock, writerMock) + updateNodebManager := managers.IUpdateNodebManager(nil) + handler := NewUpdateNodebRequestHandler(logger,rnibDataService,updateNodebManager) + return handler,readerMock, writerMock + +} + +func TestGetRanName(t *testing.T) { + handler,_,_ := setupUpdateNodebRequestHandlerTest(t) + updateEnbRequest := models.UpdateEnbRequest{} + ret := handler.getRanName(updateEnbRequest) + assert.Equal(t, "", ret ) +} -// This source code is part of the near-RT RIC (RAN Intelligent Controller) -// platform project (RICP). -package httpmsghandlers