(t *testing.T)
| 354 | } |
| 355 | |
| 356 | func TestAuthManager_authenticate_NetworkError(t *testing.T) { |
| 357 | // Use an invalid URL to simulate network error |
| 358 | httpClient := &HTTPClient{ |
| 359 | baseURL: "http://invalid-host-that-does-not-exist.local", |
| 360 | client: &http.Client{Timeout: 1 * time.Second}, |
| 361 | } |
| 362 | logger := testutils.NewTestLogger() |
| 363 | |
| 364 | authManager := NewAuthManagerWithPassword(httpClient, "testuser", "testpass", logger) |
| 365 | |
| 366 | token, err := authManager.authenticate(context.Background()) |
| 367 | assert.Error(t, err) |
| 368 | assert.Nil(t, token) |
| 369 | // Depending on network environment, the exact error may vary |
| 370 | assert.NotEmpty(t, err.Error()) |
| 371 | } |
| 372 | |
| 373 | func TestAuthManager_ClearToken(t *testing.T) { |
| 374 | httpClient := &HTTPClient{baseURL: "https://test.example.com"} |
nothing calls this directly
no test coverage detected