#[Tutorial] Android unit testing with Gradle, Robolectric, Dagger and Mockito Not long ago I faced the problem of setting up Gradle, Robolectric and Dagger for unit testing my app. And after tinkering a bit, I managed to make them all work together. In this tutorial I assume that you know how to work with Gradle, Robolectric, Dagger and Mockito separately.
I'm just going to show that they can work together pretty neatly, and how can they make Android testing a lot easier
##Wiring Robolectric and Gradle
First of all, you're going to need a fully set up Android project ready to be built with Gradle. And I'm assuming that you're using default project layout (e.g. your java sources are located in
For the next step we need to install a [Gradle Android test plugin] to a local maven repository: