Amichai | 4db397d | 2019-08-28 19:23:15 +0300 | [diff] [blame] | 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) ShutdownHandler(writer http.ResponseWriter, r *http.Request){ |
| 14 | c.Called() |
| 15 | } |
| 16 | |
| 17 | func (c *ControllerMock) X2ResetHandler(writer http.ResponseWriter, r *http.Request){ |
| 18 | writer.Header().Set("Content-Type", "application/json") |
| 19 | writer.WriteHeader(http.StatusOK) |
| 20 | |
| 21 | vars := mux.Vars(r) |
| 22 | ranName := vars["ranName"] |
| 23 | |
| 24 | writer.Write([]byte(ranName)) |
| 25 | |
| 26 | c.Called() |
| 27 | } |
| 28 | |
irina | 33f84e1 | 2019-09-10 12:40:37 +0300 | [diff] [blame] | 29 | func (c *ControllerMock) X2SetupHandler(writer http.ResponseWriter, r *http.Request){ |
| 30 | writer.Header().Set("Content-Type", "application/json") |
| 31 | writer.WriteHeader(http.StatusOK) |
| 32 | |
| 33 | c.Called() |
| 34 | } |
| 35 | |
| 36 | func (c *ControllerMock) EndcSetupHandler(writer http.ResponseWriter, r *http.Request){ |
| 37 | writer.Header().Set("Content-Type", "application/json") |
| 38 | writer.WriteHeader(http.StatusOK) |
| 39 | |
| 40 | c.Called() |
| 41 | } |