summaryrefslogtreecommitdiff
path: root/test/integration/http.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-13 17:48:35 -0600
committermo khan <mo@mokhan.ca>2025-05-13 17:48:35 -0600
commite271fcfaf93547621a7f58d1bdef49b569ceb4f8 (patch)
treef2ed53ba0cf2027cd1525f9e06bf111de0dfb251 /test/integration/http.go
parentf877592578dcc68af527f0cb25deaad997f8db66 (diff)
test: add integration test for envoy proxy configuration
Diffstat (limited to 'test/integration/http.go')
-rw-r--r--test/integration/http.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/integration/http.go b/test/integration/http.go
index 43ebac3..452c56d 100644
--- a/test/integration/http.go
+++ b/test/integration/http.go
@@ -7,6 +7,7 @@ import (
"time"
"github.com/stretchr/testify/require"
+ "github.com/xlgmokha/x/pkg/serde"
)
type testTransport struct {
@@ -34,3 +35,9 @@ func HttpGet(t *testing.T, ctx context.Context, path string) *http.Response {
return response
}
+
+func JSONBody(t *testing.T, r *http.Response) map[string]interface{} {
+ item, err := serde.FromJSON[map[string]interface{}](r.Body)
+ require.NoError(t, err)
+ return item
+}