From 0fb48188c12b06d7025537c8f12937260ce81f79 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Fri, 9 Feb 2024 23:42:05 +1100 Subject: [PATCH] chore: add Kotlin ingress test for errors --- integration/integration_test.go | 2 +- integration/testdata/kotlin/httpingress/Echo.kt | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/integration/integration_test.go b/integration/integration_test.go index 0887ffa7b..85436cbbc 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -145,9 +145,9 @@ func TestHttpIngress(t *testing.T) { assert.Equal(t, []byte("true"), resp.bodyBytes) }), httpCall(rd, http.MethodGet, "/error", nil, func(t testing.TB, resp *httpResponse) { - assert.Equal(t, 500, resp.status) assert.Equal(t, []string{"text/plain; charset=utf-8"}, resp.headers["Content-Type"]) assert.Equal(t, []byte("Error from FTL"), resp.bodyBytes) + assert.Equal(t, 500, resp.status) }), }}, } diff --git a/integration/testdata/kotlin/httpingress/Echo.kt b/integration/testdata/kotlin/httpingress/Echo.kt index 043a42f22..599723c24 100644 --- a/integration/testdata/kotlin/httpingress/Echo.kt +++ b/integration/testdata/kotlin/httpingress/Echo.kt @@ -157,4 +157,14 @@ class Echo { body = req.body ) } + + @Verb + @HttpIngress(Method.GET, "/error") + fun error(context: Context, req: HttpRequest): HttpResponse { + return HttpResponse( + status = 500, + headers = mapOf("Error" to arrayListOf("Header from FTL")), + error = "Error from FTL" + ) + } }