MCPcopy Create free account
hub / github.com/aws/aws-node-termination-handler / TestValidateWebhookConfig

Function TestValidateWebhookConfig

pkg/webhook/webhook_test.go:223–240  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

221}
222
223func TestValidateWebhookConfig(t *testing.T) {
224 var nthConfig = config.Config{}
225 err := webhook.ValidateWebhookConfig(nthConfig)
226 h.Ok(t, err)
227
228 nthConfig.WebhookURL = "http://123.123.123"
229 nthConfig.WebhookTemplate = "{{ "
230 err = webhook.ValidateWebhookConfig(nthConfig)
231 h.Assert(t, err != nil, "Failed to return error for failing to parse webhook template")
232
233 nthConfig.WebhookTemplate = "{{.cat}}"
234 err = webhook.ValidateWebhookConfig(nthConfig)
235 h.Assert(t, err != nil, "Failed to return error for failing to execute webhook template")
236
237 nthConfig.WebhookTemplate = testWebhookTemplate
238 err = webhook.ValidateWebhookConfig(nthConfig)
239 h.Ok(t, err)
240}

Callers

nothing calls this directly

Calls 1

ValidateWebhookConfigFunction · 0.92

Tested by

no test coverage detected