From a3f9e4df53a76d2313dbc815c6fd4f14fb3ca378 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Fri, 13 Jun 2025 17:50:13 -0700 Subject: [PATCH] Revert "Create ContinueAuthServiceTest.kt" This reverts commit f24b43b29d9b419ecd4eac36632ea7c55a7d022d. --- .../unit/ContinueAuthServiceTest.kt | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/ContinueAuthServiceTest.kt diff --git a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/ContinueAuthServiceTest.kt b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/ContinueAuthServiceTest.kt deleted file mode 100644 index 20a674045..000000000 --- a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/unit/ContinueAuthServiceTest.kt +++ /dev/null @@ -1,43 +0,0 @@ -package com.github.continuedev.continueintellijextension.unit - -import com.github.continuedev.continueintellijextension.auth.ContinueAuthService -import io.mockk.* -import org.junit.jupiter.api.Test -import java.lang.reflect.Field -import kotlin.test.assertNotNull - -/** - * Tests for ContinueAuthService focusing on the token refresh mechanism - */ -class ContinueAuthServiceTest { - - /** - * Verifies the token refresh mechanism is initialized in ContinueAuthService - * by checking for the existence of the coroutine scope field. - * - * This test doesn't try to verify the exact timing behavior, but ensures - * that the core component responsible for refresh is present. - */ - @Test - fun `token refresh mechanism should be initialized`() { - try { - // Get the field that contains the coroutine scope for token refresh - val field: Field = ContinueAuthService::class.java.getDeclaredField("coroutineScope") - field.isAccessible = true - - // Create an instance of the service without mocking dependencies - // This is just to check the field exists and is initialized - val authService = mockk(relaxed = true) - - // The field should exist and be accessible - assertNotNull(field, "Coroutine scope field should exist") - - // We don't need to check field.get(authService) since we're using a mockk - // and the real initialization would fail without proper environment - } catch (e: NoSuchFieldException) { - // If this happens, the field doesn't exist which means the refresh mechanism isn't implemented - throw AssertionError("The coroutineScope field doesn't exist in ContinueAuthService, " + - "which suggests the token refresh mechanism isn't implemented", e) - } - } -} \ No newline at end of file