You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
377 B

  1. package http
  2. import (
  3. "github.com/stretchr/testify/mock"
  4. "net/http"
  5. )
  6. // TestRoundTripper DEPRECATED USE net/http/httptest
  7. type TestRoundTripper struct {
  8. mock.Mock
  9. }
  10. // RoundTrip DEPRECATED USE net/http/httptest
  11. func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
  12. args := t.Called(req)
  13. return args.Get(0).(*http.Response), args.Error(1)
  14. }