October 2019
Intermediate to advanced
434 pages
11h 54m
English
If you're using a framework other than Mockito, or as an alternative to the mockito-inline approach that we described in the previous section, it's also possible to solve this problem using the allOpen compiler plugin. This plugin allows developers to make classes open for mocking/testing without having to actually mark each class as open.
To add the plugin to your Gradle project, you can modify your buildscript dependencies or use the plugins block like this:
plugins { id "org.jetbrains.kotlin.plugin.allopen" version "1.3.31"}
Once the allOpen plugin dependency has been added to your project via Gradle, Maven, and so on, the next step is to configure the plugin to recognize a custom annotation. This annotation will ...
Read now
Unlock full access