Skip to content

Commit c7b4cf3

Browse files
committed
Move *containsMocking* flag to UtSymbolicExecution
1 parent d8f175b commit c7b4cf3

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ abstract class UtExecution(
103103
var summary: List<DocStatement>? = null,
104104
var testMethodName: String? = null,
105105
var displayName: String? = null
106-
) : UtResult() {
107-
var containsMocking: Boolean = false
108-
}
106+
) : UtResult()
109107

110108
/**
111109
* Symbolic execution.
@@ -138,6 +136,8 @@ class UtSymbolicExecution(
138136
val staticFields: Set<FieldId>
139137
get() = stateBefore.statics.keys
140138

139+
var containsMocking: Boolean = false
140+
141141
override fun toString(): String = buildString {
142142
append("UtSymbolicExecution(")
143143
appendLine()

utbot-framework/src/main/kotlin/org/utbot/tests/infrastructure/TestSpecificTestCaseGenerator.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import org.utbot.framework.plugin.api.TestCaseGenerator
1616
import org.utbot.framework.plugin.api.UtError
1717
import org.utbot.framework.plugin.api.UtExecution
1818
import org.utbot.framework.plugin.api.UtMethodTestSet
19+
import org.utbot.framework.plugin.api.UtSymbolicExecution
1920
import org.utbot.framework.plugin.api.util.id
2021
import org.utbot.framework.plugin.services.JdkInfoDefaultProvider
2122
import org.utbot.framework.util.Conflict
@@ -69,13 +70,16 @@ class TestSpecificTestCaseGenerator(
6970
.collect {
7071
when (it) {
7172
is UtExecution -> {
72-
if (
73-
conflictTriggers.triggered(Conflict.ForceMockHappened) ||
74-
conflictTriggers.triggered(Conflict.ForceStaticMockHappened)
73+
if (it is UtSymbolicExecution &&
74+
(conflictTriggers.triggered(Conflict.ForceMockHappened) ||
75+
conflictTriggers.triggered(Conflict.ForceStaticMockHappened))
7576
) {
7677
it.containsMocking = true
7778

78-
conflictTriggers.reset(Conflict.ForceMockHappened, Conflict.ForceStaticMockHappened)
79+
conflictTriggers.reset(
80+
Conflict.ForceMockHappened,
81+
Conflict.ForceStaticMockHappened
82+
)
7983
}
8084
executions += it
8185
}

0 commit comments

Comments
 (0)