26 lines
562 B
Go
26 lines
562 B
Go
|
|
//go:build e2e
|
||
|
|
|
||
|
|
package e2e
|
||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/json"
|
||
|
|
"net/http"
|
||
|
|
"testing"
|
||
|
|
|
||
|
|
"github.com/stretchr/testify/require"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestHealth_Ping(t *testing.T) {
|
||
|
|
c := NewClient(t)
|
||
|
|
env := c.DoExpectOK(t, http.MethodGet, "/api/v1/health", nil, false)
|
||
|
|
var data map[string]any
|
||
|
|
require.NoError(t, json.Unmarshal(env.Data, &data))
|
||
|
|
}
|
||
|
|
|
||
|
|
func TestHealth_NoAuthRequired(t *testing.T) {
|
||
|
|
c := NewClient(t)
|
||
|
|
resp, env := c.Do(t, http.MethodGet, "/api/v1/health", nil, false)
|
||
|
|
require.Equal(t, http.StatusOK, resp.StatusCode)
|
||
|
|
require.Equal(t, int64(successCode), env.Code)
|
||
|
|
}
|