Skip to content

Commit

Permalink
test: cover response in handler
Browse files Browse the repository at this point in the history
  • Loading branch information
42atomys committed Mar 8, 2024
1 parent d8d2fc0 commit 3b7b608
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/server/v1alpha1/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
)

Expand Down

0 comments on commit 3b7b608

Please sign in to comment.