#3323·mockito

Mockito.mock() not mocking the Class in Java 17

Author: dilli-babu-sCreated Apr 24, 2024Updated Feb 19, 2026

Hey, Mockito Community.

Mockito.mock() is not working as expected in Java 17. The class which I can mock using Java 8 is not mocked when I upgraded the java version to Java 17.

Can this be solved?