MM-11855 Add App.HTTPService to allow mocking of HTTP client (#9359)

* MM-11855 Add App.HTTPService to allow mocking of HTTP client

* Initialize HTTPService earlier
Этот коммит содержится в:
Harrison Healey
2018-09-07 09:24:18 -04:00
коммит произвёл GitHub
родитель 2910007033
Коммит 0027d99855
10 изменённых файлов: 179 добавлений и 49 удалений

Просмотреть файл

@@ -244,7 +244,7 @@ func (a *App) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
}
if resp, err := a.HTTPClient(false).Do(req); err != nil {
if resp, err := a.HTTPService.MakeClient(false).Do(req); err != nil {
return nil, model.NewAppError("command", "api.command.execute_command.failed.app_error", map[string]interface{}{"Trigger": trigger}, err.Error(), http.StatusInternalServerError)
} else {
if resp.StatusCode == http.StatusOK {