From ed9e08b449a90b16382d7bd5ced74fcf1910f0a2 Mon Sep 17 00:00:00 2001 From: Michel Casabianca Date: Wed, 30 Mar 2022 10:57:03 +0200 Subject: [PATCH] Added check on response body and json --- executors/tavern/tavern.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/executors/tavern/tavern.go b/executors/tavern/tavern.go index 523c3c03..fccd6224 100644 --- a/executors/tavern/tavern.go +++ b/executors/tavern/tavern.go @@ -5,6 +5,7 @@ import ( "context" "crypto/tls" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -202,6 +203,10 @@ func (Executor) Run(ctx context.Context, step venom.TestStep) (interface{}, erro } } + if e.Response.Body != "" && e.Response.JSON != nil { + return nil, errors.New("you can't set both body and json on response") + } + start := time.Now() resp, err := client.Do(req) if err != nil {