Mock for a parent class is created #2644
Labels
comp-codegen
Issue is related to code generator
comp-spring
Issue is related to Spring projects support
ctg-bug
Issue is a bug
Description
Mock of a parent class is created, which is then tried to be cast to the needed class.
To Reproduce
spring-petclinic
Unit tests
forPetValidator
withPetClinicApplication
Expected behavior
Mock of
Pet.class
is expected to be used.Actual behavior
Mock of
NamedEntity.class
is created, and then cast toPet
is made.5 of 11 tests fail on
ClassCastException
thrown from test code.Screenshots, logs
Environment
IntelliJ IDEA version - Ultimate 2023.2
Project - Gradle
JDK - 17
The text was updated successfully, but these errors were encountered: