[RIC-249] [RIC-588] US RIC SERVICE UPDATE - Health Check Received | RIC SERVICE UPDAT...
[ric-plt/e2mgr.git] / E2Manager / mocks / nodeb_controller_mock.go
1 //
2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
4 // Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved.
5 //
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
9 //
10 //      http://www.apache.org/licenses/LICENSE-2.0
11 //
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.
17 //
18
19 //  This source code is part of the near-RT RIC (RAN Intelligent Controller)
20 //  platform project (RICP).
21
22 package mocks
23
24 import (
25         "github.com/gorilla/mux"
26         "github.com/stretchr/testify/mock"
27         "net/http"
28 )
29
30 type NodebControllerMock struct {
31         mock.Mock
32 }
33
34 func (c *NodebControllerMock) GetNodeb(writer http.ResponseWriter, r *http.Request) {
35         writer.Header().Set("Content-Type", "application/json")
36         writer.WriteHeader(http.StatusOK)
37
38         vars := mux.Vars(r)
39         ranName := vars["ranName"]
40
41         writer.Write([]byte(ranName))
42         c.Called()
43 }
44
45 func (c *NodebControllerMock) GetNodebIdList(writer http.ResponseWriter, r *http.Request) {
46         c.Called()
47 }
48
49 func (c *NodebControllerMock) Shutdown(writer http.ResponseWriter, r *http.Request) {
50         c.Called()
51 }
52
53 func (c *NodebControllerMock) X2Reset(writer http.ResponseWriter, r *http.Request) {
54         writer.Header().Set("Content-Type", "application/json")
55         writer.WriteHeader(http.StatusOK)
56
57         vars := mux.Vars(r)
58         ranName := vars["ranName"]
59
60         writer.Write([]byte(ranName))
61
62         c.Called()
63 }
64
65 func (c *NodebControllerMock) UpdateGnb(writer http.ResponseWriter, r *http.Request) {
66         writer.Header().Set("Content-Type", "application/json")
67         writer.WriteHeader(http.StatusOK)
68
69         c.Called()
70 }
71
72 func (c *NodebControllerMock) UpdateEnb(writer http.ResponseWriter, r *http.Request) {
73         writer.Header().Set("Content-Type", "application/json")
74         writer.WriteHeader(http.StatusOK)
75
76         c.Called()
77 }
78
79 func (c *NodebControllerMock) AddEnb(writer http.ResponseWriter, r *http.Request) {
80         writer.Header().Set("Content-Type", "application/json")
81         writer.WriteHeader(http.StatusCreated)
82         c.Called()
83 }
84
85 func (c *NodebControllerMock) DeleteEnb(writer http.ResponseWriter, r *http.Request) {
86         writer.Header().Set("Content-Type", "application/json")
87         writer.WriteHeader(http.StatusNoContent)
88         c.Called()
89 }
90
91 func (c *NodebControllerMock) SetGeneralConfiguration(writer http.ResponseWriter, r *http.Request) {
92         writer.Header().Set("Content-Type", "application/json")
93         writer.WriteHeader(http.StatusOK)
94
95         c.Called()
96 }
97
98 func (c *NodebControllerMock) HealthCheckRequest(writer http.ResponseWriter, r *http.Request) {
99         writer.Header().Set("Content-Type", "application/json")
100         writer.WriteHeader(http.StatusOK)
101
102         c.Called()
103 }