Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add unit test
  • Loading branch information
mmvpm committed Nov 14, 2022
commit 74d6ac2e79f71cee12797a86bc03158a8d9c992f
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ package org.utbot.sarif

import org.junit.Test
import org.mockito.Mockito
import org.utbot.framework.plugin.api.ExecutableId
import org.utbot.framework.plugin.api.UtExecution
import org.utbot.framework.plugin.api.UtImplicitlyThrownException
import org.utbot.framework.plugin.api.UtPrimitiveModel
import org.utbot.framework.plugin.api.UtMethodTestSet
import org.utbot.framework.plugin.api.UtSymbolicExecution
import org.utbot.framework.plugin.api.*

class SarifReportTest {

Expand Down Expand Up @@ -137,6 +132,19 @@ class SarifReportTest {
}
}

@Test
fun testProcessSandboxFailure() {
mockUtMethodNames()

val uncheckedException = Mockito.mock(java.security.AccessControlException::class.java)
Mockito.`when`(uncheckedException.stackTrace).thenReturn(arrayOf())
Mockito.`when`(mockUtExecution.result).thenReturn(UtSandboxFailure(uncheckedException))

val report = sarifReportMain.createReport()
val result = report.runs.first().results.first()
assert(result.message.text.contains("AccessControlException"))
}

@Test
fun testCodeFlowsStartsWithMethodCall() {
mockUtMethodNames()
Expand Down