MCPcopy Create free account
hub / github.com/UiPath/uipathcli / TestInvalidStateShowsErrorMessage

Function TestInvalidStateShowsErrorMessage

auth/oauth_authenticator_test.go:310–323  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

308}
309
310func TestInvalidStateShowsErrorMessage(t *testing.T) {
311 identityUrl, _ := url.Parse("http://localhost")
312 context := createNonConfidentialAuthContext(*identityUrl)
313 loginUrl, _ := callAuthenticator(context)
314
315 queryString := loginUrl.Query()
316 queryString.Set("state", "invalid")
317 loginUrl.RawQuery = queryString.Encode()
318 responseBody := performLogin(loginUrl, t)
319
320 if responseBody != "The query string 'state' in the redirect_url did not match" {
321 t.Errorf("Expected error message that state does not match, but got: %v", responseBody)
322 }
323}
324
325func TestMissingCodeShowsErrorMessage(t *testing.T) {
326 identityUrl, _ := url.Parse("http://localhost")

Callers

nothing calls this directly

Calls 7

callAuthenticatorFunction · 0.85
performLoginFunction · 0.85
QueryMethod · 0.80
EncodeMethod · 0.80
ParseMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected