From 25cf760bc64025d2f179213c9033647c75a01769 Mon Sep 17 00:00:00 2001 From: Rahul Banerji Date: Tue, 6 Oct 2020 11:26:30 +0530 Subject: [PATCH] [RIC-251, RIC-247] New Rest API - Get NodeB Health Check | Fixed HealthCheckRequest Response Final feature commit for RIC-95 Change-Id: Ib5d9e0c978a27790c78eb6fe3c8cc651f92f8055 Signed-off-by: Rahul Banerji --- E2Manager/container-tag.yaml | 2 +- E2Manager/controllers/nodeb_controller.go | 12 +++- .../get_nodeb_id_request_handler.go | 50 ++++++++++++++++ .../get_nodeb_id_request_handler_test.go | 66 ++++++++++++++++++++++ .../httpmsghandlers/health_check_handler.go | 3 +- .../httpmsghandlers/health_check_handler_test.go | 6 +- E2Manager/httpserver/http_server.go | 1 + E2Manager/httpserver/http_server_test.go | 18 +++++- E2Manager/managers/ran_list_manager.go | 13 +++++ E2Manager/mocks/nodeb_controller_mock.go | 13 ++++- E2Manager/mocks/ran_list_manager_mock.go | 5 ++ E2Manager/models/get_nodeb_id_request.go | 24 ++++++++ E2Manager/models/get_nodeb_id_response.go | 48 ++++++++++++++++ E2Manager/models/health_check_response.go | 47 +++++++++++++++ .../incoming_request_handler_provider.go | 2 + .../incoming_request_handler_provider_test.go | 12 ++++ 16 files changed, 315 insertions(+), 7 deletions(-) create mode 100644 E2Manager/handlers/httpmsghandlers/get_nodeb_id_request_handler.go create mode 100644 E2Manager/handlers/httpmsghandlers/get_nodeb_id_request_handler_test.go create mode 100644 E2Manager/models/get_nodeb_id_request.go create mode 100644 E2Manager/models/get_nodeb_id_response.go create mode 100644 E2Manager/models/health_check_response.go diff --git a/E2Manager/container-tag.yaml b/E2Manager/container-tag.yaml index a7a9b1b..c0c849c 100644 --- a/E2Manager/container-tag.yaml +++ b/E2Manager/container-tag.yaml @@ -1,4 +1,4 @@ # The Jenkins job requires a tag to build the Docker image. # Global-JJB script assumes this file is in the repo root. --- -tag: 5.4.11 +tag: 5.4.12 diff --git a/E2Manager/controllers/nodeb_controller.go b/E2Manager/controllers/nodeb_controller.go index 8ed6cbf..ece6941 100644 --- a/E2Manager/controllers/nodeb_controller.go +++ b/E2Manager/controllers/nodeb_controller.go @@ -51,6 +51,7 @@ type INodebController interface { UpdateGnb(writer http.ResponseWriter, r *http.Request) UpdateEnb(writer http.ResponseWriter, r *http.Request) GetNodebIdList(writer http.ResponseWriter, r *http.Request) + GetNodebId(writer http.ResponseWriter, r *http.Request) SetGeneralConfiguration(writer http.ResponseWriter, r *http.Request) AddEnb(writer http.ResponseWriter, r *http.Request) DeleteEnb(writer http.ResponseWriter, r *http.Request) @@ -75,6 +76,15 @@ func (c *NodebController) GetNodebIdList(writer http.ResponseWriter, r *http.Req c.handleRequest(writer, &r.Header, httpmsghandlerprovider.GetNodebIdListRequest, nil, false, http.StatusOK) } +func (c *NodebController) GetNodebId(writer http.ResponseWriter, r *http.Request) { + c.logger.Infof("[Client -> E2 Manager] #NodebController.GetNodebId - request: %v", c.prettifyRequest(r)) + vars := mux.Vars(r) + ranName := vars["ranName"] + request := models.GetNodebIdRequest{RanName: ranName} + + c.handleRequest(writer, &r.Header, httpmsghandlerprovider.GetNodebIdRequest, request, false, http.StatusOK) +} + func (c *NodebController) GetNodeb(writer http.ResponseWriter, r *http.Request) { c.logger.Infof("[Client -> E2 Manager] #NodebController.GetNodeb - request: %v", c.prettifyRequest(r)) vars := mux.Vars(r) @@ -202,7 +212,7 @@ func (c *NodebController) HealthCheckRequest(writer http.ResponseWriter, r *http return } - c.handleRequest(writer, &r.Header, httpmsghandlerprovider.HealthCheckRequest, request, true, http.StatusNoContent) + c.handleRequest(writer, &r.Header, httpmsghandlerprovider.HealthCheckRequest, request, true, http.StatusAccepted) } func (c *NodebController) extractRequestBodyToProto(r *http.Request, pb proto.Message, writer http.ResponseWriter) bool { diff --git a/E2Manager/handlers/httpmsghandlers/get_nodeb_id_request_handler.go b/E2Manager/handlers/httpmsghandlers/get_nodeb_id_request_handler.go new file mode 100644 index 0000000..1c84969 --- /dev/null +++ b/E2Manager/handlers/httpmsghandlers/get_nodeb_id_request_handler.go @@ -0,0 +1,50 @@ +// +// Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved. +// +// 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. +// + +// This source code is part of the near-RT RIC (RAN Intelligent Controller) +// platform project (RICP). + +package httpmsghandlers + +import ( + "e2mgr/logger" + "e2mgr/managers" + "e2mgr/models" +) + +type GetNodebIdRequestHandler struct { + logger *logger.Logger + ranListManager managers.RanListManager +} + +func NewGetNodebIdRequestHandler(logger *logger.Logger, ranListManager managers.RanListManager) *GetNodebIdRequestHandler { + return &GetNodebIdRequestHandler{ + logger: logger, + ranListManager: ranListManager, + } +} + +func (h *GetNodebIdRequestHandler) Handle(request models.Request) (models.IResponse, error) { + getNodebIdRequest := request.(models.GetNodebIdRequest) + ranName := getNodebIdRequest.RanName + + nodebId, err := h.ranListManager.GetNbIdentity(ranName) + if err != nil { + return nil, err + } + + return models.NewNodebIdResponse(nodebId), nil +} diff --git a/E2Manager/handlers/httpmsghandlers/get_nodeb_id_request_handler_test.go b/E2Manager/handlers/httpmsghandlers/get_nodeb_id_request_handler_test.go new file mode 100644 index 0000000..337212d --- /dev/null +++ b/E2Manager/handlers/httpmsghandlers/get_nodeb_id_request_handler_test.go @@ -0,0 +1,66 @@ +// +// Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved. +// +// 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. +// + +// This source code is part of the near-RT RIC (RAN Intelligent Controller) +// platform project (RICP). + +package httpmsghandlers + +import ( + "e2mgr/mocks" + "e2mgr/models" + "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities" + "github.com/stretchr/testify/assert" + "e2mgr/e2managererrors" + "testing" +) + +func setupGetNodebIdRequestHandlerTest(t *testing.T) (*GetNodebIdRequestHandler, *mocks.RanListManagerMock) { + log := initLog(t) + ranListManagerMock := &mocks.RanListManagerMock{} + + handler := NewGetNodebIdRequestHandler(log, ranListManagerMock) + return handler, ranListManagerMock +} + +func TestHandleGetNodebIdSuccess(t *testing.T) { + handler, ranListManagerMock := setupGetNodebIdRequestHandlerTest(t) + nbIdentity := &entities.NbIdentity{ + InventoryName: "test", + ConnectionStatus: entities.ConnectionStatus_CONNECTED, + HealthCheckTimestampSent: 12345678, + HealthCheckTimestampReceived: 12346548, + } + ranListManagerMock.On("GetNbIdentity",nbIdentity.InventoryName).Return(nbIdentity, nil) + response, err := handler.Handle(models.GetNodebIdRequest{RanName: nbIdentity.InventoryName}) + + assert.Nil(t, err) + assert.NotNil(t, response) + assert.IsType(t, &models.NodebIdResponse{}, response) +} + +func TestHandleGetNodebIdNotFoundFailure(t *testing.T) { + handler, ranListManagerMock := setupGetNodebIdRequestHandlerTest(t) + nbIdentity := &entities.NbIdentity{ + InventoryName: "test", + } + + ranListManagerMock.On("GetNbIdentity",nbIdentity.InventoryName).Return(nbIdentity, e2managererrors.NewResourceNotFoundError()) + _, err := handler.Handle(models.GetNodebIdRequest{RanName: nbIdentity.InventoryName}) + + assert.NotNil(t, err) + assert.IsType(t, &e2managererrors.ResourceNotFoundError{}, err) +} \ No newline at end of file diff --git a/E2Manager/handlers/httpmsghandlers/health_check_handler.go b/E2Manager/handlers/httpmsghandlers/health_check_handler.go index 7399912..785fa49 100644 --- a/E2Manager/handlers/httpmsghandlers/health_check_handler.go +++ b/E2Manager/handlers/httpmsghandlers/health_check_handler.go @@ -34,6 +34,7 @@ import ( ) var( + healthCheckSuccessResponse = "Request Accepted" healthCheckEmptyTagsToReplaceToSelfClosingTags = []string{"reject", "ignore", "protocolIEs", "procedureCode"} ) @@ -98,7 +99,7 @@ func (h *HealthCheckRequestHandler) Handle(request models.Request) (models.IResp h.logger.Infof("#HealthcheckRequest.Handle - HealthcheckTimeStampSent Update completed to RedisDB") - return nil, nil + return models.NewHealthCheckSuccessResponse(healthCheckSuccessResponse), nil } func (h *HealthCheckRequestHandler) sendRICServiceQuery(nodebInfo *entities.NodebInfo) error { diff --git a/E2Manager/handlers/httpmsghandlers/health_check_handler_test.go b/E2Manager/handlers/httpmsghandlers/health_check_handler_test.go index bbd7acd..4bce41f 100644 --- a/E2Manager/handlers/httpmsghandlers/health_check_handler_test.go +++ b/E2Manager/handlers/httpmsghandlers/health_check_handler_test.go @@ -75,8 +75,9 @@ func TestHealthCheckRequestHandlerArguementHasRanNameSuccess(t *testing.T) { ranListManagerMock.On("UpdateHealthcheckTimeStampSent",nb1.RanName).Return(oldnbIdentity, newnbIdentity) ranListManagerMock.On("UpdateNbIdentities",nb1.NodeType, []*entities.NbIdentity{oldnbIdentity}, []*entities.NbIdentity{newnbIdentity}).Return(nil) - _, err := handler.Handle(models.HealthCheckRequest{ranNames}) + resp, err := handler.Handle(models.HealthCheckRequest{ranNames}) + assert.IsType(t, &models.HealthCheckSuccessResponse{}, resp) assert.Nil(t, err) readerMock.AssertExpectations(t) } @@ -103,9 +104,10 @@ func TestHealthCheckRequestHandlerArguementHasNoRanNameSuccess(t *testing.T) { nb2 := &entities.NodebInfo{RanName: "RanName_2", ConnectionStatus: entities.ConnectionStatus_DISCONNECTED} readerMock.On("GetNodeb", "RanName_2").Return(nb2, nil) - _, err := handler.Handle(models.HealthCheckRequest{[]string{}}) + resp, err := handler.Handle(models.HealthCheckRequest{[]string{}}) assert.Nil(t, err) + assert.IsType(t, &models.HealthCheckSuccessResponse{}, resp) } diff --git a/E2Manager/httpserver/http_server.go b/E2Manager/httpserver/http_server.go index 1c4ac6c..1109f6e 100644 --- a/E2Manager/httpserver/http_server.go +++ b/E2Manager/httpserver/http_server.go @@ -47,6 +47,7 @@ func initializeRoutes(router *mux.Router, rootController controllers.IRootContro rr := r.PathPrefix("/nodeb").Subrouter() rr.HandleFunc("/states", nodebController.GetNodebIdList).Methods(http.MethodGet) + rr.HandleFunc("/states/{ranName}", nodebController.GetNodebId).Methods(http.MethodGet) rr.HandleFunc("/{ranName}", nodebController.GetNodeb).Methods(http.MethodGet) rr.HandleFunc("/enb", nodebController.AddEnb).Methods(http.MethodPost) rr.HandleFunc("/enb/{ranName}", nodebController.DeleteEnb).Methods(http.MethodDelete) diff --git a/E2Manager/httpserver/http_server_test.go b/E2Manager/httpserver/http_server_test.go index b6ccb6d..f39a259 100644 --- a/E2Manager/httpserver/http_server_test.go +++ b/E2Manager/httpserver/http_server_test.go @@ -39,6 +39,7 @@ func setupRouterAndMocks() (*mux.Router, *mocks.RootControllerMock, *mocks.Nodeb nodebControllerMock.On("Shutdown").Return(nil) nodebControllerMock.On("GetNodeb").Return(nil) nodebControllerMock.On("GetNodebIdList").Return(nil) + nodebControllerMock.On("GetNodebId").Return(nil) nodebControllerMock.On("SetGeneralConfiguration").Return(nil) nodebControllerMock.On("DeleteEnb").Return(nil) nodebControllerMock.On("AddEnb").Return(nil) @@ -54,7 +55,7 @@ func setupRouterAndMocks() (*mux.Router, *mocks.RootControllerMock, *mocks.Nodeb return router, rootControllerMock, nodebControllerMock, e2tControllerMock } -func TestRouteGetNodebIds(t *testing.T) { +func TestRouteGetNodebIdList(t *testing.T) { router, _, nodebControllerMock, _ := setupRouterAndMocks() req, err := http.NewRequest("GET", "/v1/nodeb/states", nil) @@ -67,6 +68,20 @@ func TestRouteGetNodebIds(t *testing.T) { nodebControllerMock.AssertNumberOfCalls(t, "GetNodebIdList", 1) } +func TestRouteGetNodebId(t *testing.T) { + router, _, nodebControllerMock, _ := setupRouterAndMocks() + + req, err := http.NewRequest("GET", "/v1/nodeb/states/ran1", nil) + if err != nil { + t.Fatal(err) + } + rr := httptest.NewRecorder() + router.ServeHTTP(rr, req) + + assert.Equal(t, http.StatusOK, rr.Code, "handler returned wrong status code") + nodebControllerMock.AssertNumberOfCalls(t, "GetNodebId", 1) +} + func TestRouteGetNodebRanName(t *testing.T) { router, _, nodebControllerMock, _ := setupRouterAndMocks() @@ -118,6 +133,7 @@ func TestHealthCheckRequest(t *testing.T) { rr := httptest.NewRecorder() router.ServeHTTP(rr, req) + assert.Equal(t, http.StatusAccepted, rr.Code, "handler returned wrong status code") nodebControllerMock.AssertNumberOfCalls(t, "HealthCheckRequest", 1) } diff --git a/E2Manager/managers/ran_list_manager.go b/E2Manager/managers/ran_list_manager.go index 49d7689..b6dcbcb 100755 --- a/E2Manager/managers/ran_list_manager.go +++ b/E2Manager/managers/ran_list_manager.go @@ -42,6 +42,7 @@ type RanListManager interface { UpdateNbIdentityConnectionStatus(nodeType entities.Node_Type, ranName string, connectionStatus entities.ConnectionStatus) error RemoveNbIdentity(nodeType entities.Node_Type, ranName string) error GetNbIdentityList() []*entities.NbIdentity + GetNbIdentity(ranName string) (*entities.NbIdentity, error) UpdateHealthcheckTimeStampReceived(oldRRanName string) (*entities.NbIdentity, *entities.NbIdentity) UpdateHealthcheckTimeStampSent(oldRRanName string) (*entities.NbIdentity, *entities.NbIdentity) UpdateNbIdentities(nodeType entities.Node_Type, oldNbIdentities []*entities.NbIdentity, newNbIdentities []*entities.NbIdentity) error @@ -155,6 +156,18 @@ func (m *ranListManagerInstance) GetNbIdentityList() []*entities.NbIdentity { return nbIds } +func (m *ranListManagerInstance) GetNbIdentity(ranName string) (*entities.NbIdentity, error) { + nbIdentity, ok := m.nbIdentityMap[ranName] + if !ok { + m.logger.Infof("#ranListManagerInstance.GetNbIdentity - RAN name: %s - nodeb identity not found", ranName) + return nil , e2managererrors.NewResourceNotFoundError() + } + + m.logger.Infof("#ranListManagerInstance.GetNbIdentity - RAN name: %s - nodeb identity returned", ranName) + + return nbIdentity, nil +} + func (m *ranListManagerInstance) UpdateHealthcheckTimeStampSent(oldRRanName string) (*entities.NbIdentity, *entities.NbIdentity){ currentTimeStamp := time.Now().UnixNano() oldNbIdentity := m.nbIdentityMap[oldRRanName] diff --git a/E2Manager/mocks/nodeb_controller_mock.go b/E2Manager/mocks/nodeb_controller_mock.go index d51e840..923955a 100644 --- a/E2Manager/mocks/nodeb_controller_mock.go +++ b/E2Manager/mocks/nodeb_controller_mock.go @@ -46,6 +46,17 @@ func (c *NodebControllerMock) GetNodebIdList(writer http.ResponseWriter, r *http c.Called() } +func (c *NodebControllerMock) GetNodebId(writer http.ResponseWriter, r *http.Request) { + writer.Header().Set("Content-Type", "application/json") + writer.WriteHeader(http.StatusOK) + + vars := mux.Vars(r) + ranName := vars["ranName"] + + writer.Write([]byte(ranName)) + c.Called() +} + func (c *NodebControllerMock) Shutdown(writer http.ResponseWriter, r *http.Request) { c.Called() } @@ -97,7 +108,7 @@ func (c *NodebControllerMock) SetGeneralConfiguration(writer http.ResponseWriter func (c *NodebControllerMock) HealthCheckRequest(writer http.ResponseWriter, r *http.Request) { writer.Header().Set("Content-Type", "application/json") - writer.WriteHeader(http.StatusOK) + writer.WriteHeader(http.StatusAccepted) c.Called() } diff --git a/E2Manager/mocks/ran_list_manager_mock.go b/E2Manager/mocks/ran_list_manager_mock.go index de2a2bc..11c8305 100644 --- a/E2Manager/mocks/ran_list_manager_mock.go +++ b/E2Manager/mocks/ran_list_manager_mock.go @@ -61,6 +61,11 @@ func (m *RanListManagerMock) GetNbIdentityList() []*entities.NbIdentity { return args.Get(0).([]*entities.NbIdentity) } +func (m *RanListManagerMock) GetNbIdentity(ranName string) (*entities.NbIdentity, error) { + args := m.Called(ranName) + return args.Get(0).(*entities.NbIdentity), args.Error(1) +} + func (m *RanListManagerMock) UpdateHealthcheckTimeStampSent(oldRRanName string) (*entities.NbIdentity, *entities.NbIdentity){ args := m.Called(oldRRanName) return args.Get(0).(*entities.NbIdentity), args.Get(1).(*entities.NbIdentity) diff --git a/E2Manager/models/get_nodeb_id_request.go b/E2Manager/models/get_nodeb_id_request.go new file mode 100644 index 0000000..cb0453f --- /dev/null +++ b/E2Manager/models/get_nodeb_id_request.go @@ -0,0 +1,24 @@ +// +// Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved. +// +// 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. +// + +// This source code is part of the near-RT RIC (RAN Intelligent Controller) +// platform project (RICP). + +package models + +type GetNodebIdRequest struct { + RanName string +} diff --git a/E2Manager/models/get_nodeb_id_response.go b/E2Manager/models/get_nodeb_id_response.go new file mode 100644 index 0000000..515ee0b --- /dev/null +++ b/E2Manager/models/get_nodeb_id_response.go @@ -0,0 +1,48 @@ +// +// Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved. +// +// 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. +// + +// This source code is part of the near-RT RIC (RAN Intelligent Controller) +// platform project (RICP). + +package models + +import ( + "e2mgr/e2managererrors" + "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities" + "github.com/golang/protobuf/jsonpb" +) + +type NodebIdResponse struct { + nbIdentity *entities.NbIdentity +} + +func NewNodebIdResponse(nbIdentity *entities.NbIdentity) *NodebIdResponse { + return &NodebIdResponse{ + nbIdentity: nbIdentity, + } +} + +func (response *NodebIdResponse) Marshal() ([]byte, error) { + m := jsonpb.Marshaler{} + result, err := m.MarshalToString(response.nbIdentity) + + if err != nil { + return nil, e2managererrors.NewInternalError() + } + + return []byte(result), nil +} + diff --git a/E2Manager/models/health_check_response.go b/E2Manager/models/health_check_response.go new file mode 100644 index 0000000..87dab64 --- /dev/null +++ b/E2Manager/models/health_check_response.go @@ -0,0 +1,47 @@ +// +// Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved. +// +// 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. +// + +// This source code is part of the near-RT RIC (RAN Intelligent Controller) +// platform project (RICP). + +package models + +import ( + "e2mgr/e2managererrors" + "encoding/json" +) + +type HealthCheckSuccessResponse struct { + Message string `json:"message"` +} + +func NewHealthCheckSuccessResponse(message string) *HealthCheckSuccessResponse { + return &HealthCheckSuccessResponse{ + Message: message, + } +} + +func (response HealthCheckSuccessResponse) Marshal() ([]byte, error) { + + data, err := json.Marshal(response) + + if err != nil { + return nil, e2managererrors.NewInternalError() + } + + return data, nil + +} diff --git a/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider.go b/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider.go index fba2b90..a3a8a64 100644 --- a/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider.go +++ b/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider.go @@ -39,6 +39,7 @@ const ( ResetRequest IncomingRequest = "Reset" GetNodebRequest IncomingRequest = "GetNodebRequest" GetNodebIdListRequest IncomingRequest = "GetNodebIdListRequest" + GetNodebIdRequest IncomingRequest = "GetNodebIdRequest" GetE2TInstancesRequest IncomingRequest = "GetE2TInstancesRequest" UpdateGnbRequest IncomingRequest = "UpdateGnbRequest" UpdateEnbRequest IncomingRequest = "UpdateEnbRequest" @@ -70,6 +71,7 @@ func initRequestHandlerMap(logger *logger.Logger, rmrSender *rmrsender.RmrSender SetGeneralConfigurationRequest: httpmsghandlers.NewSetGeneralConfigurationHandler(logger, rNibDataService), GetNodebRequest: httpmsghandlers.NewGetNodebRequestHandler(logger, rNibDataService), GetNodebIdListRequest: httpmsghandlers.NewGetNodebIdListRequestHandler(logger, rNibDataService, ranListManager), + GetNodebIdRequest: httpmsghandlers.NewGetNodebIdRequestHandler(logger, ranListManager), GetE2TInstancesRequest: httpmsghandlers.NewGetE2TInstancesRequestHandler(logger, e2tInstancesManager), UpdateGnbRequest: httpmsghandlers.NewUpdateNodebRequestHandler(logger, rNibDataService, updateGnbManager), UpdateEnbRequest: httpmsghandlers.NewUpdateNodebRequestHandler(logger, rNibDataService, updateEnbManager), diff --git a/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider_test.go b/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider_test.go index 87cb8f3..db1915a 100644 --- a/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider_test.go +++ b/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider_test.go @@ -82,6 +82,18 @@ func TestShutdownRequestHandler(t *testing.T) { assert.True(t, ok) } +func TestGetNodebIdRequestHandler(t *testing.T) { + provider := setupTest(t) + handler, err := provider.GetHandler(GetNodebIdRequest) + + assert.NotNil(t, provider) + assert.Nil(t, err) + + _, ok := handler.(*httpmsghandlers.GetNodebIdRequestHandler) + + assert.True(t, ok) +} + func TestSetGeneralConfigurationHandler(t *testing.T) { provider := setupTest(t) handler, err := provider.GetHandler(SetGeneralConfigurationRequest) -- 2.16.6