func RateBottleNoContent(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, bottleID int, payload *app.RateBottlePayload) http.ResponseWriter {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	err := payload.Validate()
	if err != nil {
		e, ok := err.(goa.ServiceError)
		if !ok {
			panic(err)  
		}
		t.Errorf("unexpected payload validation error: %+v", e)
		return nil
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/cellar/accounts/%v/bottles/%v/actions/rate", accountID, bottleID),
	}
	req, _err := http.NewRequest("PUT", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	prms["bottleID"] = []string{fmt.Sprintf("%v", bottleID)}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	rateCtx, __err := app.NewRateBottleContext(goaCtx, req, service)
	if __err != nil {
		_e, _ok := __err.(goa.ServiceError)
		if !_ok {
			panic("invalid test data " + __err.Error())  
		}
		t.Errorf("unexpected parameter validation error: %+v", _e)
		return nil
	}
	rateCtx.Payload = payload
	__err = ctrl.Rate(rateCtx)
	if __err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", __err, logBuf.String())
	}
	if rw.Code != 204 {
		t.Errorf("invalid response status code: got %+v, expected 204", rw.Code)
	}
	return rw
}
RateBottleNoContent runs the method Rate of the given controller with the given parameters and payload.
It returns the response writer so it's possible to inspect the response headers.
If ctx is nil then context.Background() is used.
If service is nil then a default service is created.
package test
import (
	"bytes"
	"context"
	"fmt"
	"github.com/goadesign/goa"
	"github.com/goadesign/goa-cellar/app"
	"github.com/goadesign/goa/goatest"
	"io"
	"log"
	"net/http"
	"net/http/httptest"
	"net/url"
)
func CreateBottleBadRequest(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, payload *app.CreateBottlePayload) (http.ResponseWriter, error) {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	err := payload.Validate()
	if err != nil {
		e, ok := err.(goa.ServiceError)
		if !ok {
			panic(err)  
		}
		return nil, e
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/cellar/accounts/%v/bottles", accountID),
	}
	req, _err := http.NewRequest("POST", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	createCtx, __err := app.NewCreateBottleContext(goaCtx, req, service)
	if __err != nil {
		_e, _ok := __err.(goa.ServiceError)
		if !_ok {
			panic("invalid test data " + __err.Error())  
		}
		return nil, _e
	}
	createCtx.Payload = payload
	__err = ctrl.Create(createCtx)
	if __err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", __err, logBuf.String())
	}
	if rw.Code != 400 {
		t.Errorf("invalid response status code: got %+v, expected 400", rw.Code)
	}
	var mt error
	if resp != nil {
		var __ok bool
		mt, __ok = resp.(error)
		if !__ok {
			t.Fatalf("invalid response media: got variable of type %T, value %+v, expected instance of error", resp, resp)
		}
	}
	return rw, mt
}
func CreateBottleCreated(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, payload *app.CreateBottlePayload) http.ResponseWriter {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	err := payload.Validate()
	if err != nil {
		e, ok := err.(goa.ServiceError)
		if !ok {
			panic(err)  
		}
		t.Errorf("unexpected payload validation error: %+v", e)
		return nil
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/cellar/accounts/%v/bottles", accountID),
	}
	req, _err := http.NewRequest("POST", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	createCtx, __err := app.NewCreateBottleContext(goaCtx, req, service)
	if __err != nil {
		_e, _ok := __err.(goa.ServiceError)
		if !_ok {
			panic("invalid test data " + __err.Error())  
		}
		t.Errorf("unexpected parameter validation error: %+v", _e)
		return nil
	}
	createCtx.Payload = payload
	__err = ctrl.Create(createCtx)
	if __err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", __err, logBuf.String())
	}
	if rw.Code != 201 {
		t.Errorf("invalid response status code: got %+v, expected 201", rw.Code)
	}
	return rw
}
func CreateBottleNotFound(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, payload *app.CreateBottlePayload) http.ResponseWriter {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	err := payload.Validate()
	if err != nil {
		e, ok := err.(goa.ServiceError)
		if !ok {
			panic(err)  
		}
		t.Errorf("unexpected payload validation error: %+v", e)
		return nil
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/cellar/accounts/%v/bottles", accountID),
	}
	req, _err := http.NewRequest("POST", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	createCtx, __err := app.NewCreateBottleContext(goaCtx, req, service)
	if __err != nil {
		_e, _ok := __err.(goa.ServiceError)
		if !_ok {
			panic("invalid test data " + __err.Error())  
		}
		t.Errorf("unexpected parameter validation error: %+v", _e)
		return nil
	}
	createCtx.Payload = payload
	__err = ctrl.Create(createCtx)
	if __err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", __err, logBuf.String())
	}
	if rw.Code != 404 {
		t.Errorf("invalid response status code: got %+v, expected 404", rw.Code)
	}
	return rw
}
func DeleteBottleBadRequest(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, bottleID int) (http.ResponseWriter, error) {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/cellar/accounts/%v/bottles/%v", accountID, bottleID),
	}
	req, err := http.NewRequest("DELETE", u.String(), nil)
	if err != nil {
		panic("invalid test " + err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	prms["bottleID"] = []string{fmt.Sprintf("%v", bottleID)}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	deleteCtx, _err := app.NewDeleteBottleContext(goaCtx, req, service)
	if _err != nil {
		e, ok := _err.(goa.ServiceError)
		if !ok {
			panic("invalid test data " + _err.Error())  
		}
		return nil, e
	}
	_err = ctrl.Delete(deleteCtx)
	if _err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", _err, logBuf.String())
	}
	if rw.Code != 400 {
		t.Errorf("invalid response status code: got %+v, expected 400", rw.Code)
	}
	var mt error
	if resp != nil {
		var _ok bool
		mt, _ok = resp.(error)
		if !_ok {
			t.Fatalf("invalid response media: got variable of type %T, value %+v, expected instance of error", resp, resp)
		}
	}
	return rw, mt
}
func DeleteBottleNoContent(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, bottleID int) http.ResponseWriter {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/cellar/accounts/%v/bottles/%v", accountID, bottleID),
	}
	req, err := http.NewRequest("DELETE", u.String(), nil)
	if err != nil {
		panic("invalid test " + err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	prms["bottleID"] = []string{fmt.Sprintf("%v", bottleID)}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	deleteCtx, _err := app.NewDeleteBottleContext(goaCtx, req, service)
	if _err != nil {
		e, ok := _err.(goa.ServiceError)
		if !ok {
			panic("invalid test data " + _err.Error())  
		}
		t.Errorf("unexpected parameter validation error: %+v", e)
		return nil
	}
	_err = ctrl.Delete(deleteCtx)
	if _err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", _err, logBuf.String())
	}
	if rw.Code != 204 {
		t.Errorf("invalid response status code: got %+v, expected 204", rw.Code)
	}
	return rw
}
func DeleteBottleNotFound(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, bottleID int) http.ResponseWriter {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/cellar/accounts/%v/bottles/%v", accountID, bottleID),
	}
	req, err := http.NewRequest("DELETE", u.String(), nil)
	if err != nil {
		panic("invalid test " + err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	prms["bottleID"] = []string{fmt.Sprintf("%v", bottleID)}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	deleteCtx, _err := app.NewDeleteBottleContext(goaCtx, req, service)
	if _err != nil {
		e, ok := _err.(goa.ServiceError)
		if !ok {
			panic("invalid test data " + _err.Error())  
		}
		t.Errorf("unexpected parameter validation error: %+v", e)
		return nil
	}
	_err = ctrl.Delete(deleteCtx)
	if _err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", _err, logBuf.String())
	}
	if rw.Code != 404 {
		t.Errorf("invalid response status code: got %+v, expected 404", rw.Code)
	}
	return rw
}
func ListBottleBadRequest(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, years []int) (http.ResponseWriter, error) {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	rw := httptest.NewRecorder()
	query := url.Values{}
	{
		sliceVal := make([]string, len(years))
		for i, v := range years {
			sliceVal[i] = fmt.Sprintf("%v", v)
		}
		query["years"] = sliceVal
	}
	u := &url.URL{
		Path:     fmt.Sprintf("/cellar/accounts/%v/bottles", accountID),
		RawQuery: query.Encode(),
	}
	req, err := http.NewRequest("GET", u.String(), nil)
	if err != nil {
		panic("invalid test " + err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	{
		sliceVal := make([]string, len(years))
		for i, v := range years {
			sliceVal[i] = fmt.Sprintf("%v", v)
		}
		prms["years"] = sliceVal
	}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	listCtx, _err := app.NewListBottleContext(goaCtx, req, service)
	if _err != nil {
		e, ok := _err.(goa.ServiceError)
		if !ok {
			panic("invalid test data " + _err.Error())  
		}
		return nil, e
	}
	_err = ctrl.List(listCtx)
	if _err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", _err, logBuf.String())
	}
	if rw.Code != 400 {
		t.Errorf("invalid response status code: got %+v, expected 400", rw.Code)
	}
	var mt error
	if resp != nil {
		var _ok bool
		mt, _ok = resp.(error)
		if !_ok {
			t.Fatalf("invalid response media: got variable of type %T, value %+v, expected instance of error", resp, resp)
		}
	}
	return rw, mt
}
func ListBottleNotFound(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, years []int) http.ResponseWriter {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	rw := httptest.NewRecorder()
	query := url.Values{}
	{
		sliceVal := make([]string, len(years))
		for i, v := range years {
			sliceVal[i] = fmt.Sprintf("%v", v)
		}
		query["years"] = sliceVal
	}
	u := &url.URL{
		Path:     fmt.Sprintf("/cellar/accounts/%v/bottles", accountID),
		RawQuery: query.Encode(),
	}
	req, err := http.NewRequest("GET", u.String(), nil)
	if err != nil {
		panic("invalid test " + err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	{
		sliceVal := make([]string, len(years))
		for i, v := range years {
			sliceVal[i] = fmt.Sprintf("%v", v)
		}
		prms["years"] = sliceVal
	}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	listCtx, _err := app.NewListBottleContext(goaCtx, req, service)
	if _err != nil {
		e, ok := _err.(goa.ServiceError)
		if !ok {
			panic("invalid test data " + _err.Error())  
		}
		t.Errorf("unexpected parameter validation error: %+v", e)
		return nil
	}
	_err = ctrl.List(listCtx)
	if _err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", _err, logBuf.String())
	}
	if rw.Code != 404 {
		t.Errorf("invalid response status code: got %+v, expected 404", rw.Code)
	}
	return rw
}
func ListBottleOK(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, years []int) (http.ResponseWriter, app.BottleCollection) {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	rw := httptest.NewRecorder()
	query := url.Values{}
	{
		sliceVal := make([]string, len(years))
		for i, v := range years {
			sliceVal[i] = fmt.Sprintf("%v", v)
		}
		query["years"] = sliceVal
	}
	u := &url.URL{
		Path:     fmt.Sprintf("/cellar/accounts/%v/bottles", accountID),
		RawQuery: query.Encode(),
	}
	req, err := http.NewRequest("GET", u.String(), nil)
	if err != nil {
		panic("invalid test " + err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	{
		sliceVal := make([]string, len(years))
		for i, v := range years {
			sliceVal[i] = fmt.Sprintf("%v", v)
		}
		prms["years"] = sliceVal
	}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	listCtx, _err := app.NewListBottleContext(goaCtx, req, service)
	if _err != nil {
		e, ok := _err.(goa.ServiceError)
		if !ok {
			panic("invalid test data " + _err.Error())  
		}
		t.Errorf("unexpected parameter validation error: %+v", e)
		return nil, nil
	}
	_err = ctrl.List(listCtx)
	if _err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", _err, logBuf.String())
	}
	if rw.Code != 200 {
		t.Errorf("invalid response status code: got %+v, expected 200", rw.Code)
	}
	var mt app.BottleCollection
	if resp != nil {
		var _ok bool
		mt, _ok = resp.(app.BottleCollection)
		if !_ok {
			t.Fatalf("invalid response media: got variable of type %T, value %+v, expected instance of app.BottleCollection", resp, resp)
		}
		_err = mt.Validate()
		if _err != nil {
			t.Errorf("invalid response media type: %s", _err)
		}
	}
	return rw, mt
}
func ListBottleOKTiny(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, years []int) (http.ResponseWriter, app.BottleTinyCollection) {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	rw := httptest.NewRecorder()
	query := url.Values{}
	{
		sliceVal := make([]string, len(years))
		for i, v := range years {
			sliceVal[i] = fmt.Sprintf("%v", v)
		}
		query["years"] = sliceVal
	}
	u := &url.URL{
		Path:     fmt.Sprintf("/cellar/accounts/%v/bottles", accountID),
		RawQuery: query.Encode(),
	}
	req, err := http.NewRequest("GET", u.String(), nil)
	if err != nil {
		panic("invalid test " + err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	{
		sliceVal := make([]string, len(years))
		for i, v := range years {
			sliceVal[i] = fmt.Sprintf("%v", v)
		}
		prms["years"] = sliceVal
	}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	listCtx, _err := app.NewListBottleContext(goaCtx, req, service)
	if _err != nil {
		e, ok := _err.(goa.ServiceError)
		if !ok {
			panic("invalid test data " + _err.Error())  
		}
		t.Errorf("unexpected parameter validation error: %+v", e)
		return nil, nil
	}
	_err = ctrl.List(listCtx)
	if _err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", _err, logBuf.String())
	}
	if rw.Code != 200 {
		t.Errorf("invalid response status code: got %+v, expected 200", rw.Code)
	}
	var mt app.BottleTinyCollection
	if resp != nil {
		var _ok bool
		mt, _ok = resp.(app.BottleTinyCollection)
		if !_ok {
			t.Fatalf("invalid response media: got variable of type %T, value %+v, expected instance of app.BottleTinyCollection", resp, resp)
		}
		_err = mt.Validate()
		if _err != nil {
			t.Errorf("invalid response media type: %s", _err)
		}
	}
	return rw, mt
}
func RateBottleBadRequest(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.BottleController, accountID int, bottleID int, payload *app.RateBottlePayload) (http.ResponseWriter, error) {
	var (
		logBuf bytes.Buffer
		resp   interface{}
		respSetter goatest.ResponseSetterFunc = func(r interface{}) { resp = r }
	)
	if service == nil {
		service = goatest.Service(&logBuf, respSetter)
	} else {
		logger := log.New(&logBuf, "", log.Ltime)
		service.WithLogger(goa.NewLogger(logger))
		newEncoder := func(io.Writer) goa.Encoder { return respSetter }
		service.Encoder = goa.NewHTTPEncoder()  
		service.Encoder.Register(newEncoder, "*/*")
	}
	err := payload.Validate()
	if err != nil {
		e, ok := err.(goa.ServiceError)
		if !ok {
			panic(err)  
		}
		return nil, e
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/cellar/accounts/%v/bottles/%v/actions/rate", accountID, bottleID),
	}
	req, _err := http.NewRequest("PUT", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	prms["accountID"] = []string{fmt.Sprintf("%v", accountID)}
	prms["bottleID"] = []string{fmt.Sprintf("%v", bottleID)}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "BottleTest"), rw, req, prms)
	rateCtx, __err := app.NewRateBottleContext(goaCtx, req, service)
	if __err != nil {
		_e, _ok := __err.(goa.ServiceError)
		if !_ok {
			panic("invalid test data " + __err.Error())  
		}
		return nil, _e
	}
	rateCtx.Payload = payload
	__err = ctrl.Rate(rateCtx)
	if __err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", __err, logBuf.String())
	}
	if rw.Code != 400 {
		t.Errorf("invalid response status code: got %+v, expected 400", rw.Code)
	}
	var mt error
	if resp != nil {
		var __ok bool
		mt, __ok = resp.(error)
		if !__ok {
			t.Fatalf("invalid response media: got variable of type %T, value %+v, expected instance of error", resp, resp)
		}
	}
	return rw, mt
}