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

Function TestOAuthAuthenticatorNotEnabled

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

Source from the content-addressed store, hash-verified

22)
23
24func TestOAuthAuthenticatorNotEnabled(t *testing.T) {
25 config := map[string]interface{}{
26 "clientId": "my-client-id",
27 "scopes": "OR.Users",
28 }
29 url, _ := url.Parse("http:/localhost")
30 context := createAuthContext(*url, config, false, io.Discard)
31
32 authenticator := NewOAuthAuthenticator(cache.NewFileCache(), *NewBrowserLauncher())
33 result := authenticator.Auth(context)
34 if result.Error != "" {
35 t.Errorf("Expected no error when oauth flow is skipped, but got: %v", result.Error)
36 }
37 if result.Token != nil {
38 t.Errorf("Expected auth token to be empty, but got: %v", result.Token)
39 }
40}
41
42func TestOAuthAuthenticatorInvalidConfig(t *testing.T) {
43 config := map[string]interface{}{

Callers

nothing calls this directly

Calls 6

AuthMethod · 0.95
NewFileCacheFunction · 0.92
createAuthContextFunction · 0.85
NewOAuthAuthenticatorFunction · 0.85
NewBrowserLauncherFunction · 0.85
ParseMethod · 0.65

Tested by

no test coverage detected