Add bazel rule for junit tests

This enables running the existing junit tests
through bazel.

Change-Id: I5b6d8e49bc1c2624f3b9d4a6111dcb3d718f64a3
diff --git a/BUILD b/BUILD
index 783a6c9..108dae2 100644
--- a/BUILD
+++ b/BUILD
@@ -5,6 +5,7 @@
 )
 load("//tools/bzl:genrule2.bzl", "genrule2")
 load("//tools/bzl:js.bzl", "polygerrit_plugin")
+load("//tools/bzl:junit.bzl", "junit_tests")
 load("@rules_java//java:defs.bzl", "java_library", "java_plugin")
 
 plugin_name = "task"
@@ -65,6 +66,13 @@
     app = "plugin.html",
 )
 
+junit_tests(
+    name = "junit-tests",
+    size = "small",
+    srcs = glob(["src/test/java/**/*Test.java"]),
+    deps = [plugin_name],
+)
+
 sh_test(
     name = "docker-tests",
     size = "medium",
diff --git a/tools/bzl/junit.bzl b/tools/bzl/junit.bzl
new file mode 100644
index 0000000..5df79bb
--- /dev/null
+++ b/tools/bzl/junit.bzl
@@ -0,0 +1,6 @@
+load(
+    "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
+    _junit_tests = "junit_tests",
+)
+
+junit_tests = _junit_tests
\ No newline at end of file