(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestOAuthAuthenticatorInvalidConfig(t *testing.T) { |
| 43 | config := map[string]interface{}{ |
| 44 | "clientId": 1, |
| 45 | "redirectUri": "http://localhost:0", |
| 46 | "scopes": "OR.Users", |
| 47 | } |
| 48 | url, _ := url.Parse("http:/localhost") |
| 49 | context := createAuthContext(*url, config, false, io.Discard) |
| 50 | |
| 51 | authenticator := NewOAuthAuthenticator(cache.NewFileCache(), *NewBrowserLauncher()) |
| 52 | result := authenticator.Auth(context) |
| 53 | if result.Error != "Invalid oauth authenticator configuration: Invalid value for clientId: '1'" { |
| 54 | t.Errorf("Expected error with invalid config, but got: %v", result.Error) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func TestOAuthFlowIdentityFails(t *testing.T) { |
| 59 | identityServerFake := identityServerFake{ |
nothing calls this directly
no test coverage detected