Closed
Description
Description
If we run test generation for an abstract class, the dialog appears, but further test generation fails.
To Reproduce
Steps to reproduce the behavior:
- Create a Java project
- Paste this code:
abstract public class AbstractClass {
int testMe(int x) {
if (x == 0) {
throw new IllegalStateException("123");
}
return 0;
}
}
- Run "Create Tests with UtBot" action
- Doesn't matter mocks enabled or not
- Choose the single method and press "Generate Tests" button
Expected behavior
I see these possible behaviors:
- Prohibit to generate tests for abstract classes completely, so action is disabled, if the caret context class is abstract
- Prohibit to generate tests for abstract classes completely, so popup appears if the user tries to run the action for an abstract class
- Allow to generate tests for abstract classes if mocks are enabled, and initialize an abstract class instance with mocks
Maybe there are better solutions.
Actual behavior
An error popup appears saying nothing about the class is abstract.
Visual proofs (screenshots, logs, images)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done