func createRequest(body string) (*http.Request, error) { req, err := server_mock.NewHttpRequestMock("") if err != nil { return nil, err } req.Method = "GET" req.Body = ioutil.NopCloser(bytes.NewBufferString(body)) return req, nil }
func createRequest(path string, userService booking_user_service.Service) (*http.Request, error) { login := "******" pass := "******" token, err := createToken(&booking_authentication.Authentication{Login: login, Password: pass}) if err != nil { return nil, err } _, err = userService.Create(&booking_user.User{Login: login, Password: pass}) if err != nil { return nil, err } req, err := server_mock.NewHttpRequestMock(path) if err != nil { return nil, err } req.Header["X-Auth-Token"] = []string{token} return req, nil }