Skip to content

Commit

Permalink
fix: additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiandoetsch committed Jan 8, 2024
1 parent 13dfc24 commit 4615075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class SnykCliDownloaderService {
}

fun cliSilentAutoUpdate(indicator: ProgressIndicator, project: Project) {
if (isFourDaysPassedSinceLastCheck()) {
if (isFourDaysPassedSinceLastCheck() && !ApplicationManager.getApplication().isUnitTestMode) {
val latestReleaseInfo = requestLatestReleasesInformation()

indicator.checkCanceled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,26 @@ import io.snyk.plugin.services.download.LatestReleaseInfo
import io.snyk.plugin.services.download.SnykCliDownloaderService
import io.snyk.plugin.setupDummyCliFile
import org.awaitility.Awaitility.await
import org.hamcrest.CoreMatchers.equalTo
import org.hamcrest.MatcherAssert.assertThat
import snyk.container.ContainerResult
import snyk.iac.IacResult
import snyk.oss.OssResult
import snyk.oss.OssService
import snyk.trust.confirmScanningAndSetWorkspaceTrustedStateIfNeeded
import java.util.concurrent.TimeUnit

@Suppress("FunctionName")
class SnykTaskQueueServiceTest : LightPlatformTestCase() {

private lateinit var ossServiceMock: OssService
private lateinit var downloaderServiceMock: SnykCliDownloaderService
private lateinit var snykApiServiceMock: SnykApiService

override fun setUp() {
super.setUp()
unmockkAll()
resetSettings(project)
ossServiceMock = mockk(relaxed = true)
project.replaceService(OssService::class.java, ossServiceMock, project)
mockSnykApiServiceSastEnabled()
replaceSnykApiServiceMockInContainer()
mockkStatic("io.snyk.plugin.UtilsKt")
Expand Down Expand Up @@ -85,7 +87,6 @@ class SnykTaskQueueServiceTest : LightPlatformTestCase() {

fun testSnykTaskQueueService() {
setupDummyCliFile()

val snykTaskQueueService = project.service<SnykTaskQueueService>()

snykTaskQueueService.scan()
Expand Down

0 comments on commit 4615075

Please sign in to comment.