NO-ISSUE: Updated to new versions

This commit is contained in:
2023-03-07 08:17:18 +01:00
parent 3492884cb1
commit 1b49dbaf0e
6 changed files with 48 additions and 39 deletions
+6 -5
View File
@@ -4,13 +4,14 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"os"
"testing"
"github.com/go-chi/chi"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/stretchr/testify/assert"
"scm.yoorie.de/go-lib/micro/web"
@@ -105,7 +106,7 @@ func TestReady(t *testing.T) {
resp, err := http.Get(uri)
assert.Nil(t, err)
assert.Equal(t, http.StatusOK, resp.StatusCode)
body, err := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)
healthData := web.HealthData{}
err = json.Unmarshal(body, &healthData)
assert.Nil(t, err)
@@ -118,7 +119,7 @@ func TestReadySSL(t *testing.T) {
resp, err := http.Get(uri)
assert.Nil(t, err)
assert.Equal(t, http.StatusOK, resp.StatusCode)
body, err := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)
healthData := web.HealthData{}
err = json.Unmarshal(body, &healthData)
assert.Nil(t, err)
@@ -130,7 +131,7 @@ func TestHealthy(t *testing.T) {
resp, err := http.Get(getServerURL(false, "/healthz"))
assert.Nil(t, err)
assert.Equal(t, http.StatusOK, resp.StatusCode)
body, err := ioutil.ReadAll(resp.Body)
body, _ := io.ReadAll(resp.Body)
healthData := web.HealthData{}
err = json.Unmarshal(body, &healthData)
assert.Nil(t, err)
@@ -145,7 +146,7 @@ func TestSslEndpoint(t *testing.T) {
assert.Equal(t, http.StatusOK, resp.StatusCode)
body, err := ioutil.ReadAll(resp.Body)
assert.Nil(t, err)
t.Log(fmt.Sprintf("Body: %s", string(body)))
t.Logf("Body: %s", string(body))
myData := MyData{}
err = json.Unmarshal(body, &myData)
assert.Nil(t, err)