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

Function assertHttpResponse

rest/oidc_api_test.go:947–953  ·  view source on GitHub ↗

assertHttpResponse asserts the forceError against HTTP response.

(t *testing.T, response *http.Response, forceError forceError)

Source from the content-addressed store, hash-verified

945
946// assertHttpResponse asserts the forceError against HTTP response.
947func assertHttpResponse(t *testing.T, response *http.Response, forceError forceError) {
948 bodyBytes, err := io.ReadAll(response.Body)
949 require.NoError(t, err, "error reading response body")
950 assert.Contains(t, string(bodyBytes), forceError.expectedErrorMessage)
951 assert.Equal(t, forceError.expectedErrorCode, response.StatusCode)
952 require.NoError(t, response.Body.Close(), "error closing response body")
953}
954
955// refreshProviderConfig updates the issuer URL and sets the discovery endpoint
956// in provider configuration.

Calls 3

ContainsMethod · 0.65
CloseMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected