Fix after_open config and Snapshotting RefDir tests to work with bazel

The changes I1db6fcf414b and I634b92877f added tests which were failing
with errors [1] and [2] with "bazel test //...". This was not caught
because we don't have CI running with bazel. Fix bazel build file so
that these errors are no longer thrown when run with bazel.

[1] error: cannot find symbol FileRepositoryBuilderTest
[2] error: cannot find symbol RefDirectoryTest

Bug: 581816
Signed-off-by: Prudhvi Akhil Alahari <quic_prudhvi@quicinc.com>
Change-Id: I1e57111662825f5f14f373bc4f8d24cce1fec0b8
diff --git a/org.eclipse.jgit.test/BUILD b/org.eclipse.jgit.test/BUILD
index 6f6c88c..e63c02c 100644
--- a/org.eclipse.jgit.test/BUILD
+++ b/org.eclipse.jgit.test/BUILD
@@ -51,6 +51,23 @@
     exclude = HELPERS + DATA + EXCLUDED,
 ))
 
+# Non abstract base classes used for tests by other test classes
+BASE = [
+    PKG + "internal/storage/file/FileRepositoryBuilderTest.java",
+    PKG + "internal/storage/file/RefDirectoryTest.java",
+]
+
+java_library(
+    name = "base",
+    testonly = 1,
+    srcs = BASE,
+    deps = [
+        "//lib:junit",
+        "//org.eclipse.jgit:jgit",
+        "//org.eclipse.jgit.junit:junit",
+    ],
+)
+
 java_library(
     name = "helpers",
     testonly = 1,
diff --git a/org.eclipse.jgit.test/tests.bzl b/org.eclipse.jgit.test/tests.bzl
index e201bdb..170bf0c 100644
--- a/org.eclipse.jgit.test/tests.bzl
+++ b/org.eclipse.jgit.test/tests.bzl
@@ -52,6 +52,12 @@
                 "//lib:xz",
                 "//org.eclipse.jgit.archive:jgit-archive",
             ]
+        if src.endswith("FileRepositoryBuilderAfterOpenConfigTest.java") or \
+           src.endswith("RefDirectoryAfterOpenConfigTest.java") or \
+           src.endswith("SnapshottingRefDirectoryTest.java"):
+            additional_deps = [
+                ":base",
+            ]
         heap_size = "-Xmx256m"
         if src.endswith("HugeCommitMessageTest.java"):
             heap_size = "-Xmx512m"