Skip to content

Commit ea42384

Browse files
committed
fix: avoid using lazy initialization, prefer @BeforeAll annotation
1 parent ab13deb commit ea42384

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

completions/src/test/kotlin/lsp/ws/KotlinLspProxyWSTest.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import org.eclipse.lsp4j.Position
1616
import org.junit.jupiter.api.assertAll
1717
import org.junit.jupiter.api.AfterAll
1818
import org.junit.jupiter.api.Assumptions.assumeFalse
19+
import org.junit.jupiter.api.BeforeAll
1920
import org.junit.jupiter.api.Test
2021
import org.junit.jupiter.api.TestInstance
2122
import org.junit.jupiter.api.TestInstance.Lifecycle
@@ -54,10 +55,12 @@ class KotlinLspProxyWSTest : CompletionTest, ImportTest {
5455

5556
private val defaultTimeout = 30.seconds
5657

57-
private val client: TestWSClient by lazy {
58-
val testClient = TestWSClient({ baseWsUrl }, ReactorNettyWebSocketClient())
59-
testClient.connect(defaultTimeout)
60-
testClient
58+
private lateinit var client: TestWSClient
59+
60+
@BeforeAll
61+
fun setup() {
62+
client = TestWSClient({ baseWsUrl }, ReactorNettyWebSocketClient())
63+
client.connect(defaultTimeout)
6164
}
6265

6366
override fun performCompletionChecks(

0 commit comments

Comments
 (0)