diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/UtBotTestCaseGenerator.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/UtBotTestCaseGenerator.kt index 5ef2470615..dc1b7153d6 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/UtBotTestCaseGenerator.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/UtBotTestCaseGenerator.kt @@ -48,6 +48,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import kotlinx.coroutines.yield import mu.KotlinLogging +import org.utbot.engine.* import soot.Scene import soot.jimple.JimpleBody import soot.toolkits.graph.ExceptionalUnitGraph @@ -403,7 +404,9 @@ object UtBotTestCaseGenerator : TestCaseGenerator { val signature = method.callable.signature val sootMethod = clazz.methods.singleOrNull { it.pureJavaSignature == signature } ?: error("No such $signature found") - + if (!sootMethod.canRetrieveBody()) { + error("No method body for $sootMethod found") + } val methodBody = sootMethod.jimpleBody() val graph = methodBody.graph() diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/actions/GenerateTestsAction.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/actions/GenerateTestsAction.kt index 7df71aa2f5..6b079e094f 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/actions/GenerateTestsAction.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/actions/GenerateTestsAction.kt @@ -58,6 +58,7 @@ class GenerateTestsAction : AnAction() { e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY)?.let { srcClasses += getAllClasses(project, it) } + srcClasses.removeIf { it.isInterface } var commonSourceRoot = null as VirtualFile? for (srcClass in srcClasses) { if (commonSourceRoot == null) {