mockito / mockito-scala

Mockito for Scala language
http://mockito.org
MIT License
354 stars 59 forks source link

jdk21 support issue #520

Open andreezy777 opened 9 months ago

andreezy777 commented 9 months ago

Hi guys, have problems with latest version of mockit-scala (1.17.30) on jdk21.

Error without forcing mockito-core -

org.mockito.exceptions.verification.SmartNullPointerException: 
You have a NullPointerException here:
-> at scala.collection.IterableOnceOps.toIterator(IterableOnce.scala:1313)
because this method call was *not* stubbed correctly:
-> at scala.Option.orElse(Option.scala:477)

I tried to force mockit-core and after some checks I defined that mockit-core should be 5.3.0+

5.2.0 test

Screenshot 2024-01-17 at 10 40 50

5.3.0 test

Screenshot 2024-01-17 at 10 44 02

Can you, please update mockit-core version to at least 5.3.0? (latest for now is 5.9.0, it would be nice to update to the latest one) Thank you.

andreezy777 commented 9 months ago

Looks like it's clone of https://github.com/mockito/mockito-scala/issues/515, but I want to raise this question again, because in ReadMe you said that:

Please ensure you don't declare mockito-core as a dependency. mockito-scala will pull the appropriate version automatically