func CreateMultilistBadRequest(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.MultilistController, errorsOnly bool, results bool, payload *app.ListPayloadQL) (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()
	query := url.Values{}
	{
		sliceVal := []string{fmt.Sprintf("%v", errorsOnly)}
		query["errors_only"] = sliceVal
	}
	{
		sliceVal := []string{fmt.Sprintf("%v", results)}
		query["results"] = sliceVal
	}
	u := &url.URL{
		Path:     fmt.Sprintf("/xlist/elements"),
		RawQuery: query.Encode(),
	}
	req, _err := http.NewRequest("POST", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	{
		sliceVal := []string{fmt.Sprintf("%v", errorsOnly)}
		prms["errors_only"] = sliceVal
	}
	{
		sliceVal := []string{fmt.Sprintf("%v", results)}
		prms["results"] = sliceVal
	}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "MultilistTest"), rw, req, prms)
	createCtx, __err := app.NewCreateMultilistContext(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
}
CreateMultilistBadRequest runs the method Create of the given controller with the given parameters and payload.
It returns the response writer so it's possible to inspect the response headers and the media type struct written to the response.
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"
	"io"
	"log"
	"net/http"
	"net/http/httptest"
	"net/url"
	"github.com/Vivino/rankdb/api/app"
	"github.com/goadesign/goa"
	"github.com/goadesign/goa/goatest"
)
func BackupMultilistBadRequest(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.MultilistController, payload *app.MultiListBackup) (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("/xlist/backup"),
	}
	req, _err := http.NewRequest("PUT", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "MultilistTest"), rw, req, prms)
	backupCtx, __err := app.NewBackupMultilistContext(goaCtx, req, service)
	if __err != nil {
		_e, _ok := __err.(goa.ServiceError)
		if !_ok {
			panic("invalid test data " + __err.Error())  
		}
		return nil, _e
	}
	backupCtx.Payload = payload
	__err = ctrl.Backup(backupCtx)
	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 BackupMultilistCreated(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.MultilistController, payload *app.MultiListBackup) (http.ResponseWriter, *app.RankdbCallback) {
	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, nil
	}
	rw := httptest.NewRecorder()
	u := &url.URL{
		Path: fmt.Sprintf("/xlist/backup"),
	}
	req, _err := http.NewRequest("PUT", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "MultilistTest"), rw, req, prms)
	backupCtx, __err := app.NewBackupMultilistContext(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
	}
	backupCtx.Payload = payload
	__err = ctrl.Backup(backupCtx)
	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)
	}
	var mt *app.RankdbCallback
	if resp != nil {
		var __ok bool
		mt, __ok = resp.(*app.RankdbCallback)
		if !__ok {
			t.Fatalf("invalid response media: got variable of type %T, value %+v, expected instance of app.RankdbCallback", resp, resp)
		}
		__err = mt.Validate()
		if __err != nil {
			t.Errorf("invalid response media type: %s", __err)
		}
	}
	return rw, mt
}
func BackupMultilistOK(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.MultilistController, payload *app.MultiListBackup) http.ResponseWriter {
	var (
		logBuf bytes.Buffer
		respSetter goatest.ResponseSetterFunc = func(r interface{}) {}
	)
	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("/xlist/backup"),
	}
	req, _err := http.NewRequest("PUT", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "MultilistTest"), rw, req, prms)
	backupCtx, __err := app.NewBackupMultilistContext(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
	}
	backupCtx.Payload = payload
	__err = ctrl.Backup(backupCtx)
	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)
	}
	return rw
}
func BackupMultilistUnauthorized(t goatest.TInterface, ctx context.Context, service *goa.Service, ctrl app.MultilistController, payload *app.MultiListBackup) (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("/xlist/backup"),
	}
	req, _err := http.NewRequest("PUT", u.String(), nil)
	if _err != nil {
		panic("invalid test " + _err.Error())  
	}
	prms := url.Values{}
	if ctx == nil {
		ctx = context.Background()
	}
	goaCtx := goa.NewContext(goa.WithAction(ctx, "MultilistTest"), rw, req, prms)
	backupCtx, __err := app.NewBackupMultilistContext(goaCtx, req, service)
	if __err != nil {
		_e, _ok := __err.(goa.ServiceError)
		if !_ok {
			panic("invalid test data " + __err.Error())  
		}
		return nil, _e
	}
	backupCtx.Payload = payload
	__err = ctrl.Backup(backupCtx)
	if __err != nil {
		t.Fatalf("controller returned %+v, logs:\n%s", __err, logBuf.String())
	}
	if rw.Code != 401 {
		t.Errorf("invalid response status code: got %+v, expected 401", 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
}