@@ -39,6 +39,7 @@ import org.utbot.framework.plugin.api.ClassId
39
39
import org.utbot.framework.plugin.api.MethodId
40
40
import org.utbot.framework.plugin.api.UtExecutionSuccess
41
41
import org.utbot.framework.plugin.api.UtMethodTestSet
42
+ import org.utbot.framework.plugin.api.UtSymbolicExecution
42
43
import org.utbot.framework.plugin.api.util.description
43
44
import org.utbot.framework.plugin.api.util.humanReadableName
44
45
import org.utbot.fuzzer.UtFuzzedExecution
@@ -211,16 +212,28 @@ internal class CgTestClassConstructor(val context: CgContext) :
211
212
)
212
213
}
213
214
215
+ val testCaseTestMethods = mutableListOf<CgTestMethod >()
216
+
214
217
// We cannot track mocking in fuzzed executions,
215
218
// so we generate standard tests for each [UtFuzzedExecution].
216
219
// [https://github.com/UnitTestBot/UTBotJava/issues/1137]
217
- val testCaseTestMethods = mutableListOf<CgTestMethod >()
218
- for (execution in testSet.executions.filterIsInstance<UtFuzzedExecution >()) {
219
- testCaseTestMethods + = methodConstructor.createTestMethod(methodUnderTest, execution)
220
- }
220
+ testSet.executions
221
+ .filterIsInstance<UtFuzzedExecution >()
222
+ .forEach { execution ->
223
+ testCaseTestMethods + = methodConstructor.createTestMethod(methodUnderTest, execution)
224
+ }
225
+
226
+ // Also, we generate standard tests for symbolic executions with force mocking.
227
+ // [https://github.com/UnitTestBot/UTBotJava/issues/1231]
228
+ testSet.executions
229
+ .filterIsInstance<UtSymbolicExecution >()
230
+ .filter { it.containsMocking }
231
+ .forEach { execution ->
232
+ testCaseTestMethods + = methodConstructor.createTestMethod(methodUnderTest, execution)
233
+ }
221
234
222
235
regions + = CgSimpleRegion (
223
- " FUZZER: EXECUTIONS for method ${methodUnderTest.humanReadableName} " ,
236
+ " EXECUTIONS for method ${methodUnderTest.humanReadableName} " ,
224
237
testCaseTestMethods,
225
238
)
226
239
}
0 commit comments