Specify test dependecies in rules.gradle.

The block is wrapped in an if statement, in case someone using plugin
version 1.0 includes rules.gradle.

Change-Id: Ia83c6a3c2325aaaac5055947fcd54d8809db0f98
diff --git a/build.gradle b/build.gradle
index 83acd6d..92c86eb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -25,6 +25,10 @@
 
 apply plugin: 'com.android.library'
 
+repositories {
+    jcenter()
+}
+
 android {
     compileSdkVersion 22
     buildToolsVersion = '22.0.1'
diff --git a/rules.gradle b/rules.gradle
index 40508d0..c8a95a9 100644
--- a/rules.gradle
+++ b/rules.gradle
@@ -1,3 +1,12 @@
 // See build.gradle for an explanation of what this file is.
 
 apply plugin: 'com.android.library'
+
+// Check if the android plugin version supports unit testing.
+if (configurations.findByName("testCompile")) {
+  dependencies {
+    testCompile "junit:junit:4.10"
+    testCompile "org.mockito:mockito-core:1.9.5"
+    testCompile "org.robolectric:robolectric:2.2"
+  }
+}