diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/context/spring/SpringApplicationContextImpl.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/context/spring/SpringApplicationContextImpl.kt index f0548e523d..9f86c8ae23 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/context/spring/SpringApplicationContextImpl.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/context/spring/SpringApplicationContextImpl.kt @@ -88,10 +88,12 @@ class SpringApplicationContextImpl( .withFallback(origValueProvider) .replaceTypes { description, type -> typeReplacer.replaceTypeIfNeeded(type.classId) - ?.takeIf { it != type.classId } - ?.let { replacement -> + ?.let { replacementClassId -> // TODO infer generic type of replacement - toFuzzerType(replacement.jClass, description.typeCache).addProperties( + val replacement = + if (type.classId == replacementClassId) type + else toFuzzerType(replacementClassId.jClass, description.typeCache) + replacement.addProperties( dynamicPropertiesOf(ReplacedFuzzedTypeFlag.withValue(Unit)) ) } ?: type