Remove InMemory{Content,Journal}Storage references from ProcessScopeBuilder

PiperOrigin-RevId: 255201496
Change-Id: Ib62ed6ef51c3e17053ef5700fac644e63bedf71e
diff --git a/src/main/java/com/google/android/libraries/feed/api/client/scope/BUILD b/src/main/java/com/google/android/libraries/feed/api/client/scope/BUILD
index 815b486..c22b070 100644
--- a/src/main/java/com/google/android/libraries/feed/api/client/scope/BUILD
+++ b/src/main/java/com/google/android/libraries/feed/api/client/scope/BUILD
@@ -55,7 +55,6 @@
         "//src/main/java/com/google/android/libraries/feed/feedstore",
         "//src/main/java/com/google/android/libraries/feed/hostimpl/network",
         "//src/main/java/com/google/android/libraries/feed/hostimpl/scheduler",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
         "//src/main/java/com/google/android/libraries/feed/sharedstream/piet",
         "@com_google_code_findbugs_jsr305//jar",
         "@maven//:com_android_support_support_annotations",
diff --git a/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilder.java b/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilder.java
index caaf868..0a5910a 100644
--- a/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilder.java
+++ b/src/main/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilder.java
@@ -61,8 +61,6 @@
 import com.google.android.libraries.feed.feedstore.JournalStorageDirectImpl;
 import com.google.android.libraries.feed.hostimpl.network.NetworkClientWrapper;
 import com.google.android.libraries.feed.hostimpl.scheduler.SchedulerApiWrapper;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
 import com.google.android.libraries.feed.sharedstream.piet.PietRequiredContentAdapter;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -83,12 +81,16 @@
 
   // Optional fields - if they are not provided, we will use default implementations.
   /*@MonotonicNonNull*/ private ProtoExtensionProvider protoExtensionProvider = null;
-  /*@MonotonicNonNull*/ ContentStorageDirect contentStorage = null;
-  /*@MonotonicNonNull*/ JournalStorageDirect journalStorage = null;
-  /*@MonotonicNonNull*/ private ContentStorage rawContentStorage = null;
-  /*@MonotonicNonNull*/ private JournalStorage rawJournalStorage = null;
   /*@MonotonicNonNull*/ private Clock clock;
 
+  // Either contentStorage or rawContentStorage must be provided.
+  /*@MonotonicNonNull*/ ContentStorageDirect contentStorage = null;
+  /*@MonotonicNonNull*/ private ContentStorage rawContentStorage = null;
+
+  // Either journalStorage or rawJournalStorage must be provided.
+  /*@MonotonicNonNull*/ JournalStorageDirect journalStorage = null;
+  /*@MonotonicNonNull*/ private JournalStorage rawJournalStorage = null;
+
   /** The APIs are all required to construct the scope. */
   public ProcessScopeBuilder(
       Configuration configuration,
@@ -148,7 +150,8 @@
       } else if (rawContentStorage != null) {
         contentStorage = new ContentStorageDirectImpl(rawContentStorage, mainThreadRunner);
       } else {
-        contentStorage = new InMemoryContentStorage();
+        throw new IllegalStateException(
+            "one of ContentStorage, ContentStorageDirect must be provided");
       }
     }
     return contentStorage;
@@ -165,7 +168,8 @@
       } else if (rawJournalStorage != null) {
         journalStorage = new JournalStorageDirectImpl(rawJournalStorage, mainThreadRunner);
       } else {
-        journalStorage = new InMemoryJournalStorage();
+        throw new IllegalStateException(
+            "one of JournalStorage, JournalStorageDirect must be provided");
       }
     }
     return journalStorage;
diff --git a/src/main/java/com/google/android/libraries/feed/common/testing/BUILD b/src/main/java/com/google/android/libraries/feed/common/testing/BUILD
index d20fde4..3a1d5e0 100644
--- a/src/main/java/com/google/android/libraries/feed/common/testing/BUILD
+++ b/src/main/java/com/google/android/libraries/feed/common/testing/BUILD
@@ -32,7 +32,7 @@
         "//src/main/java/com/google/android/libraries/feed/feedrequestmanager",
         "//src/main/java/com/google/android/libraries/feed/feedsessionmanager",
         "//src/main/java/com/google/android/libraries/feed/feedstore",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
         "//src/main/java/com/google/android/libraries/feed/sharedstream/piet",
         "//src/main/java/com/google/android/libraries/feed/testing/host/logging",
         "//src/main/java/com/google/android/libraries/feed/testing/host/scheduler",
diff --git a/src/main/java/com/google/android/libraries/feed/common/testing/InfraIntegrationScope.java b/src/main/java/com/google/android/libraries/feed/common/testing/InfraIntegrationScope.java
index 2cc411d..a2057a7 100644
--- a/src/main/java/com/google/android/libraries/feed/common/testing/InfraIntegrationScope.java
+++ b/src/main/java/com/google/android/libraries/feed/common/testing/InfraIntegrationScope.java
@@ -40,8 +40,8 @@
 import com.google.android.libraries.feed.feedsessionmanager.FeedSessionManagerFactory;
 import com.google.android.libraries.feed.feedsessionmanager.FeedSessionManagerImpl;
 import com.google.android.libraries.feed.feedstore.FeedStore;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryContentStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryJournalStorage;
 import com.google.android.libraries.feed.sharedstream.piet.PietRequiredContentAdapter;
 import com.google.android.libraries.feed.testing.host.logging.FakeBasicLoggingApi;
 import com.google.android.libraries.feed.testing.host.scheduler.FakeSchedulerApi;
diff --git a/src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/BUILD b/src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/BUILD
new file mode 100644
index 0000000..983afa6
--- /dev/null
+++ b/src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/BUILD
@@ -0,0 +1,13 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])  # Apache 2
+
+android_library(
+    name = "testing",
+    srcs = glob(["*.java"]),
+    deps = [
+        "//src/main/java/com/google/android/libraries/feed/api/host/storage",
+        "//src/main/java/com/google/android/libraries/feed/common",
+        "//src/main/java/com/google/android/libraries/feed/common/logging",
+    ],
+)
diff --git a/src/main/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorage.java b/src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorage.java
similarity index 98%
rename from src/main/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorage.java
rename to src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorage.java
index 8de2630..03e54d5 100644
--- a/src/main/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorage.java
+++ b/src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorage.java
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package com.google.android.libraries.feed.hostimpl.storage;
+package com.google.android.libraries.feed.hostimpl.storage.testing;
 
 import static com.google.android.libraries.feed.api.host.storage.ContentOperation.Type.DELETE;
 import static com.google.android.libraries.feed.api.host.storage.ContentOperation.Type.DELETE_BY_PREFIX;
diff --git a/src/main/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorage.java b/src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorage.java
similarity index 98%
rename from src/main/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorage.java
rename to src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorage.java
index 104e4d3..4e71d01 100644
--- a/src/main/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorage.java
+++ b/src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorage.java
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package com.google.android.libraries.feed.hostimpl.storage;
+package com.google.android.libraries.feed.hostimpl.storage.testing;
 
 import static com.google.android.libraries.feed.api.host.storage.JournalOperation.Type.APPEND;
 import static com.google.android.libraries.feed.api.host.storage.JournalOperation.Type.COPY;
diff --git a/src/main/java/com/google/android/libraries/feed/testing/store/BUILD b/src/main/java/com/google/android/libraries/feed/testing/store/BUILD
index c2c8fea..9631384 100644
--- a/src/main/java/com/google/android/libraries/feed/testing/store/BUILD
+++ b/src/main/java/com/google/android/libraries/feed/testing/store/BUILD
@@ -15,7 +15,7 @@
         "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
         "//src/main/java/com/google/android/libraries/feed/common/time",
         "//src/main/java/com/google/android/libraries/feed/feedstore",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
         "//src/main/java/com/google/android/libraries/feed/testing/host/logging",
         "//src/main/proto/com/google/android/libraries/feed/api/internal/proto:client_feed_java_proto_lite",
     ],
diff --git a/src/main/java/com/google/android/libraries/feed/testing/store/FakeStore.java b/src/main/java/com/google/android/libraries/feed/testing/store/FakeStore.java
index 3afc497..d7a96f7 100644
--- a/src/main/java/com/google/android/libraries/feed/testing/store/FakeStore.java
+++ b/src/main/java/com/google/android/libraries/feed/testing/store/FakeStore.java
@@ -26,8 +26,8 @@
 import com.google.android.libraries.feed.common.time.Clock;
 import com.google.android.libraries.feed.common.time.TimingUtils;
 import com.google.android.libraries.feed.feedstore.FeedStore;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryContentStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryJournalStorage;
 import com.google.android.libraries.feed.testing.host.logging.FakeBasicLoggingApi;
 import com.google.search.now.feed.client.StreamDataProto.StreamPayload;
 import com.google.search.now.feed.client.StreamDataProto.StreamSharedState;
diff --git a/src/test/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilderTest.java b/src/test/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilderTest.java
index ea46ea2..eb2cdca 100644
--- a/src/test/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilderTest.java
+++ b/src/test/java/com/google/android/libraries/feed/api/client/scope/ProcessScopeBuilderTest.java
@@ -83,6 +83,8 @@
                 context,
                 applicationInfo,
                 tooltipSupportedApi)
+            .setJournalStorageDirect(mock(JournalStorageDirect.class))
+            .setContentStorageDirect(mock(ContentStorageDirect.class))
             .build();
 
     assertThat(processScope.getRequestManager()).isNotNull();
@@ -106,6 +108,8 @@
                 applicationInfo,
                 tooltipSupportedApi)
             .setProtoExtensionProvider(protoExtensionProvider)
+            .setJournalStorageDirect(mock(JournalStorageDirect.class))
+            .setContentStorageDirect(mock(ContentStorageDirect.class))
             .build();
 
     assertThat(processScope.getRequestManager()).isNotNull();
diff --git a/src/test/java/com/google/android/libraries/feed/feedsessionmanager/internal/BUILD b/src/test/java/com/google/android/libraries/feed/feedsessionmanager/internal/BUILD
index cbc7dda..5460249 100644
--- a/src/test/java/com/google/android/libraries/feed/feedsessionmanager/internal/BUILD
+++ b/src/test/java/com/google/android/libraries/feed/feedsessionmanager/internal/BUILD
@@ -97,7 +97,7 @@
         "//src/main/java/com/google/android/libraries/feed/feedsessionmanager/internal",
         "//src/main/java/com/google/android/libraries/feed/feedstore",
         "//src/main/java/com/google/android/libraries/feed/feedstore/testing",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
         "//src/main/java/com/google/android/libraries/feed/testing/host/logging",
         "//src/main/proto/com/google/android/libraries/feed/api/internal/proto:client_feed_java_proto_lite",
         "//third_party:robolectric",
diff --git a/src/test/java/com/google/android/libraries/feed/feedsessionmanager/internal/SessionManagerMutationTest.java b/src/test/java/com/google/android/libraries/feed/feedsessionmanager/internal/SessionManagerMutationTest.java
index b70a7ba..bd8f1fc 100644
--- a/src/test/java/com/google/android/libraries/feed/feedsessionmanager/internal/SessionManagerMutationTest.java
+++ b/src/test/java/com/google/android/libraries/feed/feedsessionmanager/internal/SessionManagerMutationTest.java
@@ -50,8 +50,8 @@
 import com.google.android.libraries.feed.feedsessionmanager.internal.SessionManagerMutation.MutationCommitter;
 import com.google.android.libraries.feed.feedstore.FeedStore;
 import com.google.android.libraries.feed.feedstore.testing.DelegatingStore;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryContentStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryJournalStorage;
 import com.google.android.libraries.feed.testing.host.logging.FakeBasicLoggingApi;
 import com.google.common.collect.ImmutableList;
 import com.google.protobuf.ByteString;
diff --git a/src/test/java/com/google/android/libraries/feed/feedstore/BUILD b/src/test/java/com/google/android/libraries/feed/feedstore/BUILD
index ed40ea9..34a2785 100644
--- a/src/test/java/com/google/android/libraries/feed/feedstore/BUILD
+++ b/src/test/java/com/google/android/libraries/feed/feedstore/BUILD
@@ -18,7 +18,7 @@
         "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
         "//src/main/java/com/google/android/libraries/feed/feedstore",
         "//src/main/java/com/google/android/libraries/feed/feedstore/testing",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
         "//src/main/java/com/google/android/libraries/feed/testing/host/logging",
         "//third_party:robolectric",
         "@com_google_protobuf_javalite//:protobuf_java_lite",
@@ -46,7 +46,7 @@
         "//src/main/java/com/google/android/libraries/feed/feedstore",
         "//src/main/java/com/google/android/libraries/feed/feedstore/internal",
         "//src/main/java/com/google/android/libraries/feed/feedstore/testing",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
         "//src/main/proto/com/google/android/libraries/feed/api/internal/proto:client_feed_java_proto_lite",
         "//third_party:robolectric",
         "@com_google_protobuf_javalite//:protobuf_java_lite",
diff --git a/src/test/java/com/google/android/libraries/feed/feedstore/FeedStoreEphemeralModeTest.java b/src/test/java/com/google/android/libraries/feed/feedstore/FeedStoreEphemeralModeTest.java
index 82e0add..d82ffb5 100644
--- a/src/test/java/com/google/android/libraries/feed/feedstore/FeedStoreEphemeralModeTest.java
+++ b/src/test/java/com/google/android/libraries/feed/feedstore/FeedStoreEphemeralModeTest.java
@@ -26,8 +26,8 @@
 import com.google.android.libraries.feed.common.concurrent.testing.FakeThreadUtils;
 import com.google.android.libraries.feed.common.protoextensions.FeedExtensionRegistry;
 import com.google.android.libraries.feed.feedstore.testing.AbstractFeedStoreTest;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryContentStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryJournalStorage;
 import com.google.android.libraries.feed.testing.host.logging.FakeBasicLoggingApi;
 import java.util.ArrayList;
 import org.junit.Before;
diff --git a/src/test/java/com/google/android/libraries/feed/feedstore/FeedStoreTest.java b/src/test/java/com/google/android/libraries/feed/feedstore/FeedStoreTest.java
index e6e8ff4..8237416 100644
--- a/src/test/java/com/google/android/libraries/feed/feedstore/FeedStoreTest.java
+++ b/src/test/java/com/google/android/libraries/feed/feedstore/FeedStoreTest.java
@@ -48,8 +48,8 @@
 import com.google.android.libraries.feed.feedstore.testing.AbstractFeedStoreTest;
 import com.google.android.libraries.feed.feedstore.testing.DelegatingContentStorage;
 import com.google.android.libraries.feed.feedstore.testing.DelegatingJournalStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryContentStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryJournalStorage;
 import com.google.protobuf.ByteString;
 import com.google.protobuf.InvalidProtocolBufferException;
 import com.google.search.now.feed.client.StreamDataProto.StreamFeature;
diff --git a/src/test/java/com/google/android/libraries/feed/feedstore/internal/BUILD b/src/test/java/com/google/android/libraries/feed/feedstore/internal/BUILD
index c174cb6..7bf57ba 100644
--- a/src/test/java/com/google/android/libraries/feed/feedstore/internal/BUILD
+++ b/src/test/java/com/google/android/libraries/feed/feedstore/internal/BUILD
@@ -82,7 +82,7 @@
         "//src/main/java/com/google/android/libraries/feed/common/protoextensions",
         "//src/main/java/com/google/android/libraries/feed/feedstore/internal",
         "//src/main/java/com/google/android/libraries/feed/feedstore/testing",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
         "//src/main/proto/com/google/android/libraries/feed/api/internal/proto:client_feed_java_proto_lite",
         "//third_party:robolectric",
         "@com_google_protobuf_javalite//:protobuf_java_lite",
diff --git a/src/test/java/com/google/android/libraries/feed/feedstore/internal/PersistentFeedStoreTest.java b/src/test/java/com/google/android/libraries/feed/feedstore/internal/PersistentFeedStoreTest.java
index 969448e..3658bd0 100644
--- a/src/test/java/com/google/android/libraries/feed/feedstore/internal/PersistentFeedStoreTest.java
+++ b/src/test/java/com/google/android/libraries/feed/feedstore/internal/PersistentFeedStoreTest.java
@@ -38,8 +38,8 @@
 import com.google.android.libraries.feed.feedstore.testing.AbstractClearableFeedStoreTest;
 import com.google.android.libraries.feed.feedstore.testing.DelegatingContentStorage;
 import com.google.android.libraries.feed.feedstore.testing.DelegatingJournalStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryContentStorage;
-import com.google.android.libraries.feed.hostimpl.storage.InMemoryJournalStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryContentStorage;
+import com.google.android.libraries.feed.hostimpl.storage.testing.InMemoryJournalStorage;
 import com.google.protobuf.ByteString;
 import com.google.search.now.feed.client.StreamDataProto.StreamLocalAction;
 import com.google.search.now.feed.client.StreamDataProto.StreamSharedState;
diff --git a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/BUILD b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/BUILD
index 40262b6..c19daa5 100644
--- a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/BUILD
+++ b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/BUILD
@@ -3,73 +3,6 @@
 licenses(["notice"])  # Apache 2
 
 android_local_test(
-    name = "InMemoryJournalStorageTest",
-    size = "small",
-    timeout = "moderate",
-    srcs = ["InMemoryJournalStorageTest.java"],
-    aapt_version = "aapt2",
-    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
-    deps = [
-        "//src/main/java/com/google/android/libraries/feed/feedstore/testing",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
-        "//src/main/java/com/google/android/libraries/feed/testing/conformance/storage",
-        "//third_party:robolectric",
-        "@com_google_protobuf_javalite//:protobuf_java_lite",
-        "@maven//:org_mockito_mockito_core",
-        "@robolectric//bazel:android-all",
-    ],
-)
-
-android_local_test(
-    name = "InMemoryJournalStorageDirectTest",
-    size = "small",
-    timeout = "moderate",
-    srcs = ["InMemoryJournalStorageDirectTest.java"],
-    aapt_version = "aapt2",
-    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
-    deps = [
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
-        "//src/main/java/com/google/android/libraries/feed/testing/conformance/storage",
-        "//third_party:robolectric",
-        "@com_google_protobuf_javalite//:protobuf_java_lite",
-        "@robolectric//bazel:android-all",
-    ],
-)
-
-android_local_test(
-    name = "InMemoryContentStorageTest",
-    size = "small",
-    timeout = "moderate",
-    srcs = ["InMemoryContentStorageTest.java"],
-    aapt_version = "aapt2",
-    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
-    deps = [
-        "//src/main/java/com/google/android/libraries/feed/feedstore/testing",
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
-        "//src/main/java/com/google/android/libraries/feed/testing/conformance/storage",
-        "//third_party:robolectric",
-        "@com_google_protobuf_javalite//:protobuf_java_lite",
-        "@robolectric//bazel:android-all",
-    ],
-)
-
-android_local_test(
-    name = "InMemoryContentStorageDirectTest",
-    size = "small",
-    timeout = "moderate",
-    srcs = ["InMemoryContentStorageDirectTest.java"],
-    aapt_version = "aapt2",
-    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
-    deps = [
-        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage",
-        "//src/main/java/com/google/android/libraries/feed/testing/conformance/storage",
-        "//third_party:robolectric",
-        "@com_google_protobuf_javalite//:protobuf_java_lite",
-        "@robolectric//bazel:android-all",
-    ],
-)
-
-android_local_test(
     name = "PersistentContentStorageTest",
     size = "small",
     timeout = "moderate",
diff --git a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/BUILD b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/BUILD
new file mode 100644
index 0000000..438aedb
--- /dev/null
+++ b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/BUILD
@@ -0,0 +1,70 @@
+load("//src/main/java/com/google/android/libraries/feed/buildtools/testing:android_local_test.bzl", "DEFAULT_ANDROID_LOCAL_TEST_MANIFEST")
+
+licenses(["notice"])  # Apache 2
+
+android_local_test(
+    name = "InMemoryJournalStorageTest",
+    size = "small",
+    timeout = "moderate",
+    srcs = ["InMemoryJournalStorageTest.java"],
+    aapt_version = "aapt2",
+    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
+    deps = [
+        "//src/main/java/com/google/android/libraries/feed/feedstore/testing",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
+        "//src/main/java/com/google/android/libraries/feed/testing/conformance/storage",
+        "//third_party:robolectric",
+        "@com_google_protobuf_javalite//:protobuf_java_lite",
+        "@maven//:org_mockito_mockito_core",
+        "@robolectric//bazel:android-all",
+    ],
+)
+
+android_local_test(
+    name = "InMemoryJournalStorageDirectTest",
+    size = "small",
+    timeout = "moderate",
+    srcs = ["InMemoryJournalStorageDirectTest.java"],
+    aapt_version = "aapt2",
+    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
+    deps = [
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
+        "//src/main/java/com/google/android/libraries/feed/testing/conformance/storage",
+        "//third_party:robolectric",
+        "@com_google_protobuf_javalite//:protobuf_java_lite",
+        "@robolectric//bazel:android-all",
+    ],
+)
+
+android_local_test(
+    name = "InMemoryContentStorageTest",
+    size = "small",
+    timeout = "moderate",
+    srcs = ["InMemoryContentStorageTest.java"],
+    aapt_version = "aapt2",
+    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
+    deps = [
+        "//src/main/java/com/google/android/libraries/feed/feedstore/testing",
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
+        "//src/main/java/com/google/android/libraries/feed/testing/conformance/storage",
+        "//third_party:robolectric",
+        "@com_google_protobuf_javalite//:protobuf_java_lite",
+        "@robolectric//bazel:android-all",
+    ],
+)
+
+android_local_test(
+    name = "InMemoryContentStorageDirectTest",
+    size = "small",
+    timeout = "moderate",
+    srcs = ["InMemoryContentStorageDirectTest.java"],
+    aapt_version = "aapt2",
+    manifest_values = DEFAULT_ANDROID_LOCAL_TEST_MANIFEST,
+    deps = [
+        "//src/main/java/com/google/android/libraries/feed/hostimpl/storage/testing",
+        "//src/main/java/com/google/android/libraries/feed/testing/conformance/storage",
+        "//third_party:robolectric",
+        "@com_google_protobuf_javalite//:protobuf_java_lite",
+        "@robolectric//bazel:android-all",
+    ],
+)
diff --git a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorageDirectTest.java b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorageDirectTest.java
similarity index 93%
rename from src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorageDirectTest.java
rename to src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorageDirectTest.java
index da5fb0e..3c1be5a 100644
--- a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorageDirectTest.java
+++ b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorageDirectTest.java
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package com.google.android.libraries.feed.hostimpl.storage;
+package com.google.android.libraries.feed.hostimpl.storage.testing;
 
 import com.google.android.libraries.feed.testing.conformance.storage.ContentStorageDirectConformanceTest;
 import org.junit.Before;
diff --git a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorageTest.java b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorageTest.java
similarity index 94%
rename from src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorageTest.java
rename to src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorageTest.java
index 04f3e78..15a84cc 100644
--- a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryContentStorageTest.java
+++ b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryContentStorageTest.java
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package com.google.android.libraries.feed.hostimpl.storage;
+package com.google.android.libraries.feed.hostimpl.storage.testing;
 
 import com.google.android.libraries.feed.feedstore.testing.DelegatingContentStorage;
 import com.google.android.libraries.feed.testing.conformance.storage.ContentStorageConformanceTest;
diff --git a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorageDirectTest.java b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorageDirectTest.java
similarity index 93%
rename from src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorageDirectTest.java
rename to src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorageDirectTest.java
index 6e80e8e..30732dd 100644
--- a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorageDirectTest.java
+++ b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorageDirectTest.java
@@ -12,8 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package com.google.android.libraries.feed.hostimpl.storage;
-
+package com.google.android.libraries.feed.hostimpl.storage.testing;
 
 import com.google.android.libraries.feed.testing.conformance.storage.JournalStorageDirectConformanceTest;
 import org.junit.Before;
diff --git a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorageTest.java b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorageTest.java
similarity index 94%
rename from src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorageTest.java
rename to src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorageTest.java
index 667881d..83cbfdd 100644
--- a/src/test/java/com/google/android/libraries/feed/hostimpl/storage/InMemoryJournalStorageTest.java
+++ b/src/test/java/com/google/android/libraries/feed/hostimpl/storage/testing/InMemoryJournalStorageTest.java
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package com.google.android.libraries.feed.hostimpl.storage;
+package com.google.android.libraries.feed.hostimpl.storage.testing;
 
 import static org.mockito.MockitoAnnotations.initMocks;