I have a android module that uses Kotlin and by using kotlin-all open class I am making sure that I still can mock my Kotlin classes with Mockito. The problem is with this approach it makes my Kotlin classes open outside testing as well and now someone can extend this class witch I don't want to allow.
This is my configuration
apply plugin: "kotlin-allopen"
allOpen {
annotation("com.me.Open")
}
I am looking for a way to enable this plugin only for testing, allowing mock Kotlin classes while stoping extension from Kotlin non-open class. Any Idea?
BTW, I don't want to use mockito-inline plugin since it slows down our tests by noticeable measure.