(t *testing.T)
| 308 | } |
| 309 | |
| 310 | func 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 | |
| 325 | func TestMissingCodeShowsErrorMessage(t *testing.T) { |
| 326 | identityUrl, _ := url.Parse("http://localhost") |
nothing calls this directly
no test coverage detected