diff --git a/utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/jc/JcTestExecutor.kt b/utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/jc/JcTestExecutor.kt index 6d0733a9bb..e91829e419 100644 --- a/utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/jc/JcTestExecutor.kt +++ b/utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/jc/JcTestExecutor.kt @@ -149,10 +149,12 @@ class JcTestExecutor( override fun allocateString(value: UTestExpression): UTestExpression = value override fun resolveObject(ref: UConcreteHeapRef, heapRef: UHeapRef, type: JcClassType): UTestExpression { - if (ref !in resolvedMethodMocks) { + if (ref !in resolvedMethodMocks || type.jcClass.name != "java.util.Random") { return super.resolveObject(ref, heapRef, type) } + // Hack: mock only Random + val mocks = resolvedMethodMocks.getValue(ref) val fieldValues = mutableMapOf()