Closed macsystems closed 5 years ago
Hello,
it looks like its impossible to mock internal kotlin classes
internal class UnderTest{ fun methodToTest(){} }
import com.nhaarman.mockito_kotlin.mock internal class SimpleTest{ val mock = mock<UnderTest>() @Test fun test(){ } }
Running the Test results in a well known exception:
Cannot mock/spy class com.name.UnderTest Mockito cannot mock/spy because : - final class
Note: The Test itself need to be internal so that the compiler likes it
The exception complains about final classes, not internal. open your class.
final
internal
open
Hello,
it looks like its impossible to mock internal kotlin classes
Running the Test results in a well known exception:
Note: The Test itself need to be internal so that the compiler likes it