diff --git a/http/doc.go b/http/doc.go index c78401451..695167c6d 100644 --- a/http/doc.go +++ b/http/doc.go @@ -1,2 +1,2 @@ -// A set of tools to make testing http activity using the Go testing system easier. +// Package http DEPRECATED USE net/http/httptest package http diff --git a/http/test_response_writer.go b/http/test_response_writer.go index efd4d6649..5c3f813fa 100644 --- a/http/test_response_writer.go +++ b/http/test_response_writer.go @@ -4,10 +4,7 @@ import ( "net/http" ) -// TestResponseWriter is a http.ResponseWriter object that keeps track of all activity -// allowing you to make assertions about how it was used. -// -// DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. +// TestResponseWriter DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. type TestResponseWriter struct { // StatusCode is the last int written by the call to WriteHeader(int) @@ -20,7 +17,7 @@ type TestResponseWriter struct { header http.Header } -// Header gets the http.Header describing the headers that were set in this response. +// Header DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. func (rw *TestResponseWriter) Header() http.Header { if rw.header == nil { @@ -30,7 +27,7 @@ func (rw *TestResponseWriter) Header() http.Header { return rw.header } -// Write writes the specified bytes to Output. +// Write DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. func (rw *TestResponseWriter) Write(bytes []byte) (int, error) { // assume 200 success if no header has been set @@ -46,7 +43,7 @@ func (rw *TestResponseWriter) Write(bytes []byte) (int, error) { } -// WriteHeader stores the HTTP status code in the StatusCode. +// WriteHeader DEPRECATED: We recommend you use http://golang.org/pkg/net/http/httptest instead. func (rw *TestResponseWriter) WriteHeader(i int) { rw.StatusCode = i } diff --git a/http/test_round_tripper.go b/http/test_round_tripper.go index b0ad54527..b1e32f1d8 100644 --- a/http/test_round_tripper.go +++ b/http/test_round_tripper.go @@ -5,10 +5,12 @@ import ( "net/http" ) +// TestRoundTripper DEPRECATED USE net/http/httptest type TestRoundTripper struct { mock.Mock } +// RoundTrip DEPRECATED USE net/http/httptest func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { args := t.Called(req) return args.Get(0).(*http.Response), args.Error(1)