(t *testing.T)
| 127 | } |
| 128 | |
| 129 | func TestAuthManager_GetValidToken_WithAPIToken(t *testing.T) { |
| 130 | httpClient := &HTTPClient{baseURL: "https://test.example.com"} |
| 131 | logger := testutils.NewTestLogger() |
| 132 | apiToken := testTokenValue |
| 133 | |
| 134 | authManager := NewAuthManagerWithToken(httpClient, apiToken, logger) |
| 135 | |
| 136 | token, err := authManager.GetValidToken(context.Background()) |
| 137 | require.NoError(t, err) |
| 138 | assert.NotNil(t, token) |
| 139 | assert.Equal(t, apiToken, token.Ticket) |
| 140 | assert.Equal(t, "", token.CSRFToken) |
| 141 | assert.Equal(t, "api-token", token.Username) |
| 142 | assert.True(t, token.IsValid()) |
| 143 | } |
| 144 | |
| 145 | func TestAuthManager_GetValidToken_WithCachedToken(t *testing.T) { |
| 146 | httpClient := &HTTPClient{baseURL: "https://test.example.com"} |
nothing calls this directly
no test coverage detected