From 3b7b6086d99221e9f58e626bc2931be85136b8e6 Mon Sep 17 00:00:00 2001 From: 42Atomys Date: Fri, 8 Mar 2024 01:58:07 +0100 Subject: [PATCH] test: cover response in handler --- internal/server/v1alpha1/handlers_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/server/v1alpha1/handlers_test.go b/internal/server/v1alpha1/handlers_test.go index 6238e11..1d435f9 100644 --- a/internal/server/v1alpha1/handlers_test.go +++ b/internal/server/v1alpha1/handlers_test.go @@ -72,7 +72,7 @@ func TestServer_WebhookHandler(t *testing.T) { ) assert.Equal(t, - http.StatusNoContent, + http.StatusOK, testServerWebhookHandlerHelper(t, &Server{ config: &config.Configuration{ APIVersion: "v1alpha1", @@ -81,13 +81,13 @@ func TestServer_WebhookHandler(t *testing.T) { Name: "test", EntrypointURL: "/test", Response: config.ResponseSpec{ - Formatting: &config.FormattingSpec{Template: "{{.Payload}}"}, - HttpCode: 204, + Formatting: &config.FormattingSpec{Template: "test-payload"}, + HttpCode: 200, ContentType: "application/json", }, }}, }, - webhookService: func(s *Server, spec *config.WebhookSpec, r *http.Request) (string, error) { return "", nil }, + webhookService: func(s *Server, spec *config.WebhookSpec, r *http.Request) (string, error) { return "test-payload", nil }, }).Code, )