diff --git a/utbot-cli/src/main/kotlin/org/utbot/cli/GenerateTestsCommand.kt b/utbot-cli/src/main/kotlin/org/utbot/cli/GenerateTestsCommand.kt index d54288ea25..0380efaa7b 100644 --- a/utbot-cli/src/main/kotlin/org/utbot/cli/GenerateTestsCommand.kt +++ b/utbot-cli/src/main/kotlin/org/utbot/cli/GenerateTestsCommand.kt @@ -94,6 +94,9 @@ class GenerateTestsCommand : val targetMethods = classUnderTest.targetMethods() initializeEngine(workingDirectory) + if (targetMethods.isEmpty()) { + throw Exception("Nothing to process. No methods were provided") + } // utContext is used in `generateTestCases`, `generateTest`, `generateReport` withUtContext(UtContext(targetMethods.first().clazz.java.classLoader)) {