func (m *MockHTTPTransport) SetResponsePayloads(payloads [][]byte) {
	m.init()
	m.responses = make([]*http.Response, len(payloads))
	m.errors = make([]error, len(payloads))
	for i, payload := range payloads {
		encodedMessage := base64.StdEncoding.EncodeToString(payload)
		reader := strings.NewReader(encodedMessage)
		m.responses[i] = &http.Response{
			Body:          ioutil.NopCloser(reader),
			ContentLength: int64(len(payload)),
			Status:        "200 OK",
			StatusCode:    200,
			Proto:         "HTTP/1.0",
			ProtoMajor:    1,
			ProtoMinor:    0,
		}
	}
}
// SetResponsePayloads registers multiple payloads in the transport.
// The payloads will be encoded as Base64 and wrapped into a io.Reader. This also
// sets a status code of 200 and the errors for the given calls will be nil.
// This method will reset any responses or errors previously registered.
SetResponsePayloads registers multiple payloads in the transport.
The payloads will be encoded as Base64 and wrapped into a io.Reader. This also
sets a status code of 200 and the errors for the given calls will be nil.
This method will reset any responses or errors previously registered.
// SetResponsePayloads registers multiple payloads in the transport . // The payloads will be encoded as Base64 and wrapped into a io . Reader . This also // sets a status code of 200 and the errors for the given calls will be nil . // This method will reset any responses or errors previously registered .
func (m *MockHTTPTransport) SetResponsePayloads(payloads [][]byte) {
	m.init()
	m.responses = make([]*http.Response, len(payloads))
	m.errors = make([]error, len(payloads))
	for i, payload := range payloads {
		encodedMessage := base64.StdEncoding.EncodeToString(payload)
		reader := strings.NewReader(encodedMessage)
		m.responses[i] = &http.Response{
			Body:          ioutil.NopCloser(reader),
			ContentLength: int64(len(payload)),
			Status:        "200 OK",
			StatusCode:    200,
			Proto:         "HTTP/1.0",
			ProtoMajor:    1,
			ProtoMinor:    0,
		}
	}
}
func ( m * MockHTTPTransport ) SetResponsePayloads ( payloads [ ] [ ] byte ) { m . init ( ) m . responses = make ( [ ] * http . Response , len ( payloads ) ) m . errors = make ( [ ] error , len ( payloads ) ) for i , payload := range payloads { encodedMessage := base64 . StdEncoding . EncodeToString ( payload ) reader := strings . NewReader ( encodedMessage ) m . responses [ i ] = & http . Response { Body : ioutil . NopCloser ( reader ) , ContentLength : int64 ( len ( payload ) ) , Status : " " , StatusCode : 200 , Proto : " " , ProtoMajor : 1 , ProtoMinor : 0 , } } }
SetResponsePayloads registers multiple payloads in the transport.
SetResponsePayloads registers multiple payloads in the transport .