MCPcopy Create free account
hub / github.com/crewjam/saml / TestFetchMetadata

Function TestFetchMetadata

samlsp/fetch_metadata_test.go:15–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestFetchMetadata(t *testing.T) {
16 test := NewMiddlewareTest(t)
17
18 testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
19 assert.Check(t, is.Equal("/metadata", r.URL.String()))
20 w.Write(test.IDPMetadata)
21 }))
22
23 fmt.Println(testServer.URL + "/metadata")
24 u, _ := url.Parse(testServer.URL + "/metadata")
25 md, err := FetchMetadata(context.Background(), testServer.Client(), *u)
26 assert.Check(t, err)
27 assert.Check(t, is.Equal("https://idp.testshib.org/idp/shibboleth", md.EntityID))
28}

Callers

nothing calls this directly

Calls 4

NewMiddlewareTestFunction · 0.85
FetchMetadataFunction · 0.85
StringMethod · 0.80
PrintlnMethod · 0.80

Tested by

no test coverage detected