Skip to content

Removed unused TestHelper methods #650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@
import static com.google.firebase.firestore.testutil.TestUtil.key;
import static org.mockito.Mockito.mock;

import com.google.android.gms.tasks.Task;
import com.google.firebase.database.collection.ImmutableSortedSet;
import com.google.firebase.firestore.core.DocumentViewChange;
import com.google.firebase.firestore.core.DocumentViewChange.Type;
import com.google.firebase.firestore.core.ViewSnapshot;
import com.google.firebase.firestore.model.Document;
import com.google.firebase.firestore.model.DocumentKey;
import com.google.firebase.firestore.model.DocumentSet;
import com.google.firebase.firestore.model.ResourcePath;
import com.google.firebase.firestore.model.value.ObjectValue;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.robolectric.Robolectric;

public class TestUtil {

Expand All @@ -43,14 +39,6 @@ public static FirebaseFirestore firestore() {
return FIRESTORE;
}

public static CollectionReference collectionReference(String path) {
return new CollectionReference(ResourcePath.fromString(path), FIRESTORE);
}

public static DocumentReference documentReference(String path) {
return new DocumentReference(key(path), FIRESTORE);
}

public static DocumentSnapshot documentSnapshot(
String path, Map<String, Object> data, boolean isFromCache) {
if (data == null) {
Expand Down Expand Up @@ -133,13 +121,4 @@ public static QuerySnapshot querySnapshot(
/* excludesMetadataChanges= */ false);
return new QuerySnapshot(query(path), viewSnapshot, FIRESTORE);
}

public static <T> T waitFor(Task<T> task) {
if (!task.isComplete()) {
Robolectric.flushBackgroundThreadScheduler();
}
Assert.assertTrue(
"Expected task to be completed after background thread flush", task.isComplete());
return task.getResult();
}
}
Loading