Skip to content

Commit 4417c2b

Browse files
committed
resolve TODOs
1 parent 327f2c4 commit 4417c2b

File tree

1 file changed

+4
-35
lines changed

1 file changed

+4
-35
lines changed

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/BsonTypesTest.java

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ public void listenToDocumentsWithBsonTypes() throws Throwable {
250250
}
251251
}
252252

253-
// TODO(Mila/BSON): remove the cache population after updating the
254-
// assertSDKQueryResultsConsistentWithBackend
255253
@Test
256254
public void filterAndOrderBsonObjectIds() throws Exception {
257255
Map<String, Map<String, Object>> docs =
@@ -264,9 +262,6 @@ public void filterAndOrderBsonObjectIds() throws Exception {
264262
map("key", new BsonObjectId("507f191e810c19729de860ec")));
265263
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
266264

267-
// Pre-populate the cache with all docs
268-
waitFor(randomColl.get());
269-
270265
Query orderedQuery =
271266
randomColl
272267
.orderBy("key", Direction.DESCENDING)
@@ -296,9 +291,6 @@ public void filterAndOrderBsonTimestamps() throws Exception {
296291
map("key", new BsonTimestamp(2, 1)));
297292
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
298293

299-
// Pre-populate the cache with all docs
300-
waitFor(randomColl.get());
301-
302294
Query orderedQuery =
303295
randomColl
304296
.orderBy("key", Direction.DESCENDING)
@@ -328,9 +320,6 @@ public void filterAndOrderBsonBinaryData() throws Exception {
328320
map("key", BsonBinaryData.fromBytes(2, new byte[] {1, 2, 2})));
329321
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
330322

331-
// Pre-populate the cache with all docs
332-
waitFor(randomColl.get());
333-
334323
Query orderedQuery =
335324
randomColl
336325
.orderBy("key", Direction.DESCENDING)
@@ -357,9 +346,6 @@ public void filterAndOrderRegex() throws Exception {
357346
"c", map("key", new RegexValue("^baz", "i")));
358347
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
359348

360-
// Pre-populate the cache with all docs
361-
waitFor(randomColl.get());
362-
363349
Query orderedQuery =
364350
randomColl
365351
.orderBy("key", Direction.DESCENDING)
@@ -386,9 +372,6 @@ public void filterAndOrderInt32() throws Exception {
386372
"c", map("key", new Int32Value(2)));
387373
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
388374

389-
// Pre-populate the cache with all docs
390-
waitFor(randomColl.get());
391-
392375
Query orderedQuery =
393376
randomColl.orderBy("key", Direction.DESCENDING).whereGreaterThan("key", new Int32Value(-1));
394377

@@ -413,9 +396,6 @@ public void filterAndOrderMinKey() throws Exception {
413396
"e", map("key", MaxKey.instance()));
414397
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
415398

416-
// Pre-populate the cache with all docs
417-
waitFor(randomColl.get());
418-
419399
Query query =
420400
randomColl
421401
.orderBy(
@@ -426,9 +406,8 @@ public void filterAndOrderMinKey() throws Exception {
426406

427407
assertSDKQueryResultsConsistentWithBackend(randomColl, query, docs, Arrays.asList("b", "a"));
428408

429-
// TODO(Mila/BSON): uncomment this test when null value inclusion is fixed
430-
// query = randomColl.whereNotEqualTo("key", MinKey.instance());
431-
// assertSDKQueryResultsConsistentWithBackend(query, docs, Arrays.asList("d", "e"));
409+
query = randomColl.whereNotEqualTo("key", MinKey.instance());
410+
assertSDKQueryResultsConsistentWithBackend(randomColl, query, docs, Arrays.asList("d", "e"));
432411

433412
query = randomColl.whereGreaterThanOrEqualTo("key", MinKey.instance());
434413
assertSDKQueryResultsConsistentWithBackend(randomColl, query, docs, Arrays.asList("a", "b"));
@@ -454,9 +433,6 @@ public void filterAndOrderMaxKey() throws Exception {
454433
"e", map("key", null));
455434
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
456435

457-
// Pre-populate the cache with all docs
458-
waitFor(randomColl.get());
459-
460436
Query query =
461437
randomColl
462438
.orderBy(
@@ -467,9 +443,8 @@ public void filterAndOrderMaxKey() throws Exception {
467443

468444
assertSDKQueryResultsConsistentWithBackend(randomColl, query, docs, Arrays.asList("d", "c"));
469445

470-
// TODO(Mila/BSON): uncomment this test when null value inclusion is fixed
471-
// query = randomColl.whereNotEqualTo("key", MaxKey.instance());
472-
// assertSDKQueryResultsConsistentWithBackend(randomColl, query, docs, Arrays.asList("a", "b"));
446+
query = randomColl.whereNotEqualTo("key", MaxKey.instance());
447+
assertSDKQueryResultsConsistentWithBackend(randomColl, query, docs, Arrays.asList("a", "b"));
473448

474449
query = randomColl.whereGreaterThanOrEqualTo("key", MaxKey.instance());
475450
assertSDKQueryResultsConsistentWithBackend(randomColl, query, docs, Arrays.asList("c", "d"));
@@ -495,9 +470,6 @@ public void filterNullValueWithBsonTypes() throws Exception {
495470
"e", map("key", MaxKey.instance()));
496471
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
497472

498-
// Pre-populate the cache with all docs
499-
waitFor(randomColl.get());
500-
501473
Query query = randomColl.whereEqualTo("key", null);
502474
assertSDKQueryResultsConsistentWithBackend(randomColl, query, docs, Arrays.asList("b", "c"));
503475

@@ -550,9 +522,6 @@ public void orderBsonTypesTogether() throws Exception {
550522
map("key", MaxKey.instance()));
551523
CollectionReference randomColl = testCollectionWithDocsOnNightly(docs);
552524

553-
// Pre-populate the cache with all docs
554-
waitFor(randomColl.get());
555-
556525
Query orderedQuery = randomColl.orderBy("key", Direction.DESCENDING);
557526
List<String> expectedDocs =
558527
Arrays.asList(

0 commit comments

Comments
 (0)