(t *testing.T)
| 109 | } |
| 110 | |
| 111 | func TestAuthManager_EnsureAuthenticated_WithToken(t *testing.T) { |
| 112 | // Create a mock HTTP client |
| 113 | httpClient := &HTTPClient{ |
| 114 | baseURL: "https://test.example.com", |
| 115 | client: &http.Client{}, |
| 116 | } |
| 117 | logger := testutils.NewTestLogger() |
| 118 | token := testTokenValue |
| 119 | |
| 120 | authManager := NewAuthManagerWithToken(httpClient, token, logger) |
| 121 | |
| 122 | err := authManager.EnsureAuthenticated() |
| 123 | assert.NoError(t, err) |
| 124 | |
| 125 | // Verify that the HTTP client has the token set |
| 126 | assert.Equal(t, token, httpClient.apiToken) |
| 127 | } |
| 128 | |
| 129 | func TestAuthManager_GetValidToken_WithAPIToken(t *testing.T) { |
| 130 | httpClient := &HTTPClient{baseURL: "https://test.example.com"} |
nothing calls this directly
no test coverage detected