

package tests

import (
	"net/http"
	"strconv"
)

// Returns a responder whose response body is the request body
func NewEchoResponder(status int) func(*http.Request) (*http.Response, error) {
	return func(req *http.Request) (*http.Response, error) {
		return &http.Response{
			Status:     strconv.Itoa(status),
			StatusCode: status,
			Body:       req.Body,
			Header:     http.Header{},
		}, nil
	}
}
