Add unit tests for provide runner route

This commit is contained in:
Jan-Eric Hellenberg
2021-06-08 15:50:48 +02:00
committed by Jan-Eric Hellenberg
parent 7bbd7b7bae
commit 61bc7d0143
7 changed files with 206 additions and 129 deletions

View File

@@ -3,6 +3,7 @@
package helpers
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
@@ -157,10 +158,10 @@ func HttpPut(url string, body io.Reader) (response *http.Response, err error) {
}
func HttpPutJSON(url string, body interface{}) (response *http.Response, err error) {
requestString, err := json.Marshal(body)
requestByteString, err := json.Marshal(body)
if err != nil {
return
}
reader := strings.NewReader(string(requestString))
reader := bytes.NewReader(requestByteString)
return HttpPut(url, reader)
}