No tests are generated for methods in enums with nested anonymous classes #617
Labels
comp-codegen
Issue is related to code generator
comp-symbolic-engine
Issue is related to the symbolic execution engine
ctg-bug
Issue is a bug
spec-release-tailings
Failed to include in the current release, let's include it in the next one
Description
No tests can't be generated by the symbolic engine for methods in enum classes whose values have corresponding anonymous classes.
Note: I am not currently sure that there are no cases where tests would be generated, this question has to be investigated. See #300 for a sample configuration for the contest estimator that will be useful for collecting data.
To Reproduce
Generate the test suite for the
State.findStateByCode()
method in the following code.Expected behavior
A non-empty test suite should be generated, no errors should be reported.
Actual behavior
No tests are generated, the error message is displayed: "UtBot failed to generate any test cases for class State".
Environment
This behavior does not depend on the specific test framework configuration and mocking settings. It can be reproduced in both Java 8 and Java 11, as well as on fuzzer settings.
Additional context
Enum constructor does not prevent test generation, anonymous nested classes do.
The issue is probably related to the limited support of anonymous classes in the code generator. It may be reproduced even with fuzzing turned on, and even with fuzzing only, so it seems that it is a codegen error. At the same time, anonymous class processing in the symbolic engine should be checked too.
The text was updated successfully, but these errors were encountered: