MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestSanitizedUrl

Function TestSanitizedUrl

db/event_handler_test.go:34–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestSanitizedUrl(t *testing.T) {
35 var wh *Webhook
36 ctx := base.TestCtx(t)
37 wh = &Webhook{
38 url: "https://foo%40bar.baz:my-%24ecret-p%40%25%24w0rd@example.com:8888/bar",
39 }
40 assert.Equal(t, "https://xxxxx:xxxxx@example.com:8888/bar", wh.SanitizedUrl(ctx))
41
42 wh = &Webhook{
43 url: "https://example.com/does-not-count-as-url-embedded:basic-auth-credentials@qux",
44 }
45 assert.Equal(t, "https://example.com/does-not-count-as-url-embedded:basic-auth-credentials@qux", wh.SanitizedUrl(ctx))
46}
47
48func TestCallValidateFunction(t *testing.T) {
49 // Boolean return type handling of CallValidateFunction; Mock up a document change event and

Callers

nothing calls this directly

Calls 3

SanitizedUrlMethod · 0.95
TestCtxFunction · 0.92
EqualMethod · 0.45

Tested by

no test coverage detected