[RICPLT-1898] - Replace http router to gorilla-mux + UT + Automation code
[ric-plt/e2mgr.git] / E2Manager / mocks / controllerMock.go
diff --git a/E2Manager/mocks/controllerMock.go b/E2Manager/mocks/controllerMock.go
new file mode 100644 (file)
index 0000000..390005c
--- /dev/null
@@ -0,0 +1,28 @@
+package mocks
+
+import (
+       "github.com/gorilla/mux"
+       "github.com/stretchr/testify/mock"
+       "net/http"
+)
+
+type ControllerMock struct {
+       mock.Mock
+}
+
+func (c *ControllerMock) ShutdownHandler(writer http.ResponseWriter, r *http.Request){
+       c.Called()
+}
+
+func (c *ControllerMock) X2ResetHandler(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()
+}
+