Enable tests in Bazel build

Change-Id: I14c67406b0b3e132a102a7e6539a53884c609d9c
diff --git a/BUILD b/BUILD
index 30b996a..34035ce 100644
--- a/BUILD
+++ b/BUILD
@@ -1,4 +1,5 @@
-load("//tools/bzl:plugin.bzl", "gerrit_plugin")
+load("//tools/bzl:plugin.bzl", "gerrit_plugin", "PLUGIN_DEPS", "PLUGIN_TEST_DEPS")
+load("//tools/bzl:junit.bzl", "junit_tests")
 
 gerrit_plugin(
     name = "automerge-plugin",
@@ -9,3 +10,12 @@
     ],
     resources = glob(["src/main/resources/*"]),
 )
+
+junit_tests(
+    name = "test",
+    testonly = 1,
+    srcs = glob(["src/test/java/**/*.java"]),
+    deps = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
+        ":automerge-plugin",
+    ],
+)