I know this is experimental but it seems to work for my project, I followed the instructions in this blog. That was perfectly fine while I was writing the code I produced classes like this 1Ĭlass LocalBinder : Binder () Īnother approach, which is the one I settled on, was to enable the experimental feature in Mockito to allow mocking of final classes. By contrast in Kotlin classes are sealed by default and can only be inherited or overridden if we use the keyword open. In Java classes are only sealed if you use the keyword final. I have tripped over an issue in writing unit tests. ![]() The project has been progressing well and hopefully will be published this year. ![]() I am staring to get to grips with Kotlin and I have writted about my challenges in starting a new Kotlin project. Im trying to mock a simple interface in my Kotlin project, but receiving the following error: Mockito cannot mock this class: interface MyInterface.
0 Comments
Leave a Reply. |