Skip to content

Commit 52ea0b8

Browse files
Make CLI throw Exception for empty classes (#378)
1 parent 4c6d73b commit 52ea0b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

utbot-cli/src/main/kotlin/org/utbot/cli/GenerateTestsCommand.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ class GenerateTestsCommand :
9494
val targetMethods = classUnderTest.targetMethods()
9595
initializeEngine(workingDirectory)
9696

97+
if (targetMethods.isEmpty()) {
98+
throw Exception("Nothing to process. No methods were provided")
99+
}
97100
// utContext is used in `generateTestCases`, `generateTest`, `generateReport`
98101
withUtContext(UtContext(targetMethods.first().clazz.java.classLoader)) {
99102

0 commit comments

Comments
 (0)