From da487d83e0034838b11bf41c8c22a9e7429b1e0b Mon Sep 17 00:00:00 2001 From: victoriafomina Date: Fri, 1 Jul 2022 18:23:33 +0300 Subject: [PATCH] Add no methods were provided Exception --- .../src/main/kotlin/org/utbot/cli/GenerateTestsCommand.kt | 3 +++ 1 file changed, 3 insertions(+) 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)) {