[RIC-251, RIC-247] New Rest API - Get NodeB Health Check | Fixed HealthCheckRequest...
[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) GetNodebId(writer http.ResponseWriter, r *http.Request) {
50         writer.Header().Set("Content-Type", "application/json")
51         writer.WriteHeader(http.StatusOK)
52
53         vars := mux.Vars(r)
54         ranName := vars["ranName"]
55
56         writer.Write([]byte(ranName))
57         c.Called()
58 }
59
60 func (c *NodebControllerMock) Shutdown(writer http.ResponseWriter, r *http.Request) {
61         c.Called()
62 }
63
64 func (c *NodebControllerMock) X2Reset(writer http.ResponseWriter, r *http.Request) {
65         writer.Header().Set("Content-Type", "application/json")
66         writer.WriteHeader(http.StatusOK)
67
68         vars := mux.Vars(r)
69         ranName := vars["ranName"]
70
71         writer.Write([]byte(ranName))
72
73         c.Called()
74 }
75
76 func (c *NodebControllerMock) UpdateGnb(writer http.ResponseWriter, r *http.Request) {
77         writer.Header().Set("Content-Type", "application/json")
78         writer.WriteHeader(http.StatusOK)
79
80         c.Called()
81 }
82
83 func (c *NodebControllerMock) UpdateEnb(writer http.ResponseWriter, r *http.Request) {
84         writer.Header().Set("Content-Type", "application/json")
85         writer.WriteHeader(http.StatusOK)
86
87         c.Called()
88 }
89
90 func (c *NodebControllerMock) AddEnb(writer http.ResponseWriter, r *http.Request) {
91         writer.Header().Set("Content-Type", "application/json")
92         writer.WriteHeader(http.StatusCreated)
93         c.Called()
94 }
95
96 func (c *NodebControllerMock) DeleteEnb(writer http.ResponseWriter, r *http.Request) {
97         writer.Header().Set("Content-Type", "application/json")
98         writer.WriteHeader(http.StatusNoContent)
99         c.Called()
100 }
101
102 func (c *NodebControllerMock) SetGeneralConfiguration(writer http.ResponseWriter, r *http.Request) {
103         writer.Header().Set("Content-Type", "application/json")
104         writer.WriteHeader(http.StatusOK)
105
106         c.Called()
107 }
108
109 func (c *NodebControllerMock) HealthCheckRequest(writer http.ResponseWriter, r *http.Request) {
110         writer.Header().Set("Content-Type", "application/json")
111         writer.WriteHeader(http.StatusAccepted)
112
113         c.Called()
114 }