2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
4 // Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved.
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
10 // http://www.apache.org/licenses/LICENSE-2.0
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
19 // This source code is part of the near-RT RIC (RAN Intelligent Controller)
20 // platform project (RICP).
25 "github.com/gorilla/mux"
26 "github.com/stretchr/testify/mock"
30 type NodebControllerMock struct {
34 func (c *NodebControllerMock) GetNodeb(writer http.ResponseWriter, r *http.Request) {
35 writer.Header().Set("Content-Type", "application/json")
36 writer.WriteHeader(http.StatusOK)
39 ranName := vars["ranName"]
41 writer.Write([]byte(ranName))
45 func (c *NodebControllerMock) GetNodebIdList(writer http.ResponseWriter, r *http.Request) {
49 func (c *NodebControllerMock) GetNodebId(writer http.ResponseWriter, r *http.Request) {
50 writer.Header().Set("Content-Type", "application/json")
51 writer.WriteHeader(http.StatusOK)
54 ranName := vars["ranName"]
56 writer.Write([]byte(ranName))
60 func (c *NodebControllerMock) Shutdown(writer http.ResponseWriter, r *http.Request) {
64 func (c *NodebControllerMock) X2Reset(writer http.ResponseWriter, r *http.Request) {
65 writer.Header().Set("Content-Type", "application/json")
66 writer.WriteHeader(http.StatusOK)
69 ranName := vars["ranName"]
71 writer.Write([]byte(ranName))
76 func (c *NodebControllerMock) UpdateGnb(writer http.ResponseWriter, r *http.Request) {
77 writer.Header().Set("Content-Type", "application/json")
78 writer.WriteHeader(http.StatusOK)
83 func (c *NodebControllerMock) UpdateEnb(writer http.ResponseWriter, r *http.Request) {
84 writer.Header().Set("Content-Type", "application/json")
85 writer.WriteHeader(http.StatusOK)
90 func (c *NodebControllerMock) AddEnb(writer http.ResponseWriter, r *http.Request) {
91 writer.Header().Set("Content-Type", "application/json")
92 writer.WriteHeader(http.StatusCreated)
96 func (c *NodebControllerMock) DeleteEnb(writer http.ResponseWriter, r *http.Request) {
97 writer.Header().Set("Content-Type", "application/json")
98 writer.WriteHeader(http.StatusNoContent)
102 func (c *NodebControllerMock) SetGeneralConfiguration(writer http.ResponseWriter, r *http.Request) {
103 writer.Header().Set("Content-Type", "application/json")
104 writer.WriteHeader(http.StatusOK)
109 func (c *NodebControllerMock) HealthCheckRequest(writer http.ResponseWriter, r *http.Request) {
110 writer.Header().Set("Content-Type", "application/json")
111 writer.WriteHeader(http.StatusAccepted)