Search in sources :

Example 1 with TestUtil

use of com.google.firebase.firestore.testutil.TestUtil in project firebase-android-sdk by firebase.

the class IndexBackfillerTest method verifyQueryResults.

private void verifyQueryResults(Query query, String... expectedKeys) {
    Target target = query.toTarget();
    List<DocumentKey> actualKeys = indexManager.getDocumentsMatchingTarget(target);
    if (actualKeys == null) {
        assertEquals(0, expectedKeys.length);
    } else {
        assertThat(actualKeys).containsExactlyElementsIn(Arrays.stream(expectedKeys).map(TestUtil::key).toArray());
    }
}
Also used : Target(com.google.firebase.firestore.core.Target) TestUtil(com.google.firebase.firestore.testutil.TestUtil) DocumentKey(com.google.firebase.firestore.model.DocumentKey)

Aggregations

Target (com.google.firebase.firestore.core.Target)1 DocumentKey (com.google.firebase.firestore.model.DocumentKey)1 TestUtil (com.google.firebase.firestore.testutil.TestUtil)1