[RICPLT-2523] Add SelectE2TInstance mechanism | Change Setup flow | Refactor code...
[ric-plt/e2mgr.git] / E2Manager / mocks / controllerMock.go
1 package mocks
2
3 import (
4         "github.com/gorilla/mux"
5         "github.com/stretchr/testify/mock"
6         "net/http"
7 )
8
9 type ControllerMock struct {
10         mock.Mock
11 }
12
13 func (c *ControllerMock) GetNodeb(writer http.ResponseWriter, r *http.Request){
14                 writer.Header().Set("Content-Type", "application/json")
15                 writer.WriteHeader(http.StatusOK)
16
17                 vars := mux.Vars(r)
18                 ranName := vars["ranName"]
19
20                 writer.Write([]byte(ranName))
21
22                 c.Called()
23 }
24
25 func (c *ControllerMock) GetNodebIdList(writer http.ResponseWriter, r *http.Request){
26         c.Called()
27 }
28
29
30 func (c *ControllerMock) Shutdown(writer http.ResponseWriter, r *http.Request){
31         c.Called()
32 }
33
34 func (c *ControllerMock) X2Reset(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
43         c.Called()
44 }
45
46 func (c *ControllerMock) X2Setup(writer http.ResponseWriter, r *http.Request){
47         writer.Header().Set("Content-Type", "application/json")
48         writer.WriteHeader(http.StatusOK)
49
50         c.Called()
51 }
52
53 func (c *ControllerMock) EndcSetup(writer http.ResponseWriter, r *http.Request){
54         writer.Header().Set("Content-Type", "application/json")
55         writer.WriteHeader(http.StatusOK)
56
57         c.Called()
58 }