title: Kotlin+Mockito2: ClassNotFoundException for presenter tests
body: <p>I have a sample app written in Kotlin based on <a href="https://github.com/android10/Android-CleanArchitecture" rel="nofollow noreferrer">CleanArchitecture-Android</a> style. Below is the configuration for the app:</p>
  
  <p><strong>presentation/build.gradle</strong></p>
  
  <pre><code>dependencies {
    implementation project(':domain')
  
    def presentationDependencies = rootProject.ext.presentationDependencies
    def commonDependencies = rootProject.ext.commonDependencies
  
    testCompile testingDependencies.junit
    testCompile testingDependencies.mockito // org.mockito:mockito-inline:2.10.0
  }
  </code></pre>
  
  <p><strong>presentation/src/test/java/package/RepoPreferencesPresenterTest.kt</strong></p>
  
  <pre><code>internal class RepoPreferencesPresenterTest : UnitTest() {
    // FIXME: Mocking fails
    @Mock private lateinit var mockRepositoriesUseCase: RepositoriesUseCase
    @Mock private lateinit var mockView: RepoPreferencesContract.View
  
    private lateinit var presenter: RepoPreferencesPresenter&lt;RepoPreferencesContract.View&gt;
  
    @Before
    fun setUp() {
      presenter = RepoPreferencesPresenter(mockRepositoriesUseCase)
      presenter.onAttach(mockView)
    }
  }
  </code></pre>
  
  <p>When I try to run the testcase, I'd face with <code>ClassNotFoundException</code> everytime. Unable to mock the UseCase present in <strong>domain module</strong> for the presenter tests, other than that app is running fine.</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Lcom/sample/domain/usecases/RepositoriesUseCase;
  ......
  Caused by: java.lang.ClassNotFoundException: com.sample.domain.usecases.RepositoriesUseCase
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  </code></pre>
  
  <p>Any idea how to solve the problem? (I'd also tried using mock-maker-inline but it doesn't work)</p>