From 8557349c43039cf5d279041c1efbcc0029143311 Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Mon, 18 Mar 2024 08:18:15 +0100 Subject: [PATCH] fix: failing test in Language Server Wrapper --- src/test/java/snyk/common/lsp/LanguageServerWrapperTest.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/snyk/common/lsp/LanguageServerWrapperTest.kt b/src/test/java/snyk/common/lsp/LanguageServerWrapperTest.kt index e7e871c43..8169635ad 100644 --- a/src/test/java/snyk/common/lsp/LanguageServerWrapperTest.kt +++ b/src/test/java/snyk/common/lsp/LanguageServerWrapperTest.kt @@ -22,13 +22,17 @@ import org.junit.After import org.junit.Before import org.junit.Test import snyk.pluginInfo +import snyk.trust.WorkspaceTrustService import java.util.concurrent.CompletableFuture class LanguageServerWrapperTest { + private val applicationMock: Application = mockk() private val projectMock: Project = mockk() private val lsMock: LanguageServer = mockk() private val settings = SnykApplicationSettingsStateService() + private val trustServiceMock = mockk(relaxed = true) + private lateinit var cut: LanguageServerWrapper @Before @@ -37,8 +41,8 @@ class LanguageServerWrapperTest { mockkStatic("io.snyk.plugin.UtilsKt") mockkStatic(ApplicationManager::class) mockkStatic(ApplicationManager::class) - val applicationMock = mockk() every { ApplicationManager.getApplication() } returns applicationMock + every { applicationMock.getService(WorkspaceTrustService::class.java) } returns trustServiceMock val projectManagerMock = mockk() every { applicationMock.getService(ProjectManager::class.java) } returns projectManagerMock