You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mockito's Answers.CALLS_REAL_METHODS doesn't work with JDK 18 when the real method is a default method on an interface that's being mocked. It fails like this:
org.mockito.exceptions.base.MockitoException:
Cannot call abstract real method on java object!
Calling real methods is only possible when mocking non abstract method.
//correct example:
when(mockOfConcreteClass.nonAbstractMethod()).thenCallRealMethod();
at org.springframework.boot.context.properties.source.AliasedConfigurationPropertySourceTests.containsDescendantOfWhenSourceReturnsUnknownShouldReturnUnknown(AliasedConfigurationPropertySourceTests.java:62)
…
The problem only occurs in the 2.5.x branch where we're using Mockito 3.9.0. It doesn't occur in 2.6.x where we've upgraded to Mockito 4.0.0.
JDK 18 has reached its release candidate phase and will GA on 22 March. We should add CI for it to verify compatibility.
The text was updated successfully, but these errors were encountered: