Closed
Description
Some tests that are using Mockito are failing under Java 21 with this error
Cannot call abstract real method on java object!
Calling real methods is only possible when mocking non abstract method.
This seem to be caused by an open issue in Mockito.
There is a workaround available (set the net.bytebuddy.experimental
system property to true
), which can be set in the unit tests' @BeforeAll
annotated method.
Steps to reproduce:
- Use Java 21 (reproducible with Temurin JDK 21.0.4)
- Run
mvn clean test
- Observe failures