@@ -39,6 +39,7 @@ import org.utbot.framework.plugin.api.ClassId
3939import org.utbot.framework.plugin.api.MethodId
4040import org.utbot.framework.plugin.api.UtExecutionSuccess
4141import org.utbot.framework.plugin.api.UtMethodTestSet
42+ import org.utbot.framework.plugin.api.UtSymbolicExecution
4243import org.utbot.framework.plugin.api.util.description
4344import org.utbot.framework.plugin.api.util.humanReadableName
4445import org.utbot.fuzzer.UtFuzzedExecution
@@ -211,16 +212,28 @@ internal class CgTestClassConstructor(val context: CgContext) :
211212 )
212213 }
213214
215+ val testCaseTestMethods = mutableListOf<CgTestMethod >()
216+
214217 // We cannot track mocking in fuzzed executions,
215218 // so we generate standard tests for each [UtFuzzedExecution].
216219 // [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+ }
221234
222235 regions + = CgSimpleRegion (
223- " FUZZER: EXECUTIONS for method ${methodUnderTest.humanReadableName} " ,
236+ " EXECUTIONS for method ${methodUnderTest.humanReadableName} " ,
224237 testCaseTestMethods,
225238 )
226239 }
0 commit comments