-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restore changes from corrupted branch feat-protocol-test
- Loading branch information
Showing
3 changed files
with
32 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package protocoltest | ||
|
||
import ( | ||
"io/ioutil" | ||
"net/http" | ||
"strings" | ||
) | ||
|
||
// HTTPClient is a mock http client used by protocol test cases to | ||
// respond success response back | ||
type HTTPClient struct{} | ||
|
||
// Do returns a mock success response to caller | ||
func (*HTTPClient) Do(request *http.Request) (*http.Response, error) { | ||
return &http.Response{ | ||
StatusCode: 200, | ||
Header: request.Header, | ||
Body: ioutil.NopCloser(strings.NewReader("")), | ||
Request: request, | ||
}, nil | ||
} | ||
|
||
// NewClient returns pointer of a new HTTPClient for protocol test client | ||
func NewClient() *HTTPClient { | ||
return &HTTPClient{} | ||
} |