diff options
| -rw-r--r-- | test/integration/container_test.go | 2 | ||||
| -rw-r--r-- | test/integration/http.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/integration/container_test.go b/test/integration/container_test.go index 6c371ba..2d68236 100644 --- a/test/integration/container_test.go +++ b/test/integration/container_test.go @@ -74,7 +74,7 @@ func TestContainer(t *testing.T) { response := HttpGet(t, ctx, envoyAdminEndpoint+"/config_dump") require.Equal(t, http.StatusOK, response.StatusCode) - body := JSONBody(t, response) + body := JSONBody[map[string]interface{}](t, response) assert.NotEmpty(t, "listener_0", body["configs"]) }) diff --git a/test/integration/http.go b/test/integration/http.go index 452c56d..20991a2 100644 --- a/test/integration/http.go +++ b/test/integration/http.go @@ -36,8 +36,8 @@ 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) +func JSONBody[T any](t *testing.T, r *http.Response) T { + item, err := serde.FromJSON[T](r.Body) require.NoError(t, err) return item } |
