|
14 | 14 |
|
15 | 15 | package com.google.firebase.firestore;
|
16 | 16 |
|
| 17 | +import static com.google.firebase.firestore.testutil.IntegrationTestUtil.isRunningAgainstEmulator; |
17 | 18 | import static com.google.firebase.firestore.testutil.IntegrationTestUtil.querySnapshotToIds;
|
18 | 19 | import static com.google.firebase.firestore.testutil.IntegrationTestUtil.querySnapshotToValues;
|
19 | 20 | import static com.google.firebase.firestore.testutil.IntegrationTestUtil.testCollection;
|
|
38 | 39 | import java.util.Map;
|
39 | 40 | import java.util.concurrent.Semaphore;
|
40 | 41 | import org.junit.After;
|
41 |
| -import org.junit.Ignore; |
| 42 | +import org.junit.Assume; |
42 | 43 | import org.junit.Test;
|
43 | 44 | import org.junit.runner.RunWith;
|
44 | 45 |
|
@@ -428,33 +429,33 @@ public void testQueriesCanUseArrayContainsFilters() {
|
428 | 429 | // much of anything else interesting to test.
|
429 | 430 | }
|
430 | 431 |
|
431 |
| - // TODO(in-queries): Re-enable once emulator support is added to travis. |
| 432 | + // TODO(in-queries): Re-enable in prod once feature lands in backend. |
432 | 433 | @Test
|
433 |
| - @Ignore |
434 | 434 | public void testQueriesCanUseInFilters() {
|
435 |
| - Map<String, Object> docA = map("zip", 98101); |
436 |
| - Map<String, Object> docB = map("zip", 91102); |
437 |
| - Map<String, Object> docC = map("zip", 98103); |
438 |
| - Map<String, Object> docD = map("zip", asList(98101)); |
439 |
| - Map<String, Object> docE = map("zip", asList("98101", map("zip", 98101))); |
440 |
| - Map<String, Object> docF = map("zip", map("code", 500)); |
| 435 | + Assume.assumeTrue(isRunningAgainstEmulator()); |
| 436 | + Map<String, Object> docA = map("zip", 98101L); |
| 437 | + Map<String, Object> docB = map("zip", 91102L); |
| 438 | + Map<String, Object> docC = map("zip", 98103L); |
| 439 | + Map<String, Object> docD = map("zip", asList(98101L)); |
| 440 | + Map<String, Object> docE = map("zip", asList("98101", map("zip", 98101L))); |
| 441 | + Map<String, Object> docF = map("zip", map("code", 500L)); |
441 | 442 | CollectionReference collection =
|
442 | 443 | testCollectionWithDocs(
|
443 | 444 | map("a", docA, "b", docB, "c", docC, "d", docD, "e", docE, "f", docF));
|
444 | 445 |
|
445 | 446 | // Search for zips matching [98101, 98103].
|
446 |
| - QuerySnapshot snapshot = waitFor(collection.whereIn("zip", asList(98101, 98103)).get()); |
| 447 | + QuerySnapshot snapshot = waitFor(collection.whereIn("zip", asList(98101L, 98103L)).get()); |
447 | 448 | assertEquals(asList(docA, docC), querySnapshotToValues(snapshot));
|
448 | 449 |
|
449 | 450 | // With objects.
|
450 |
| - snapshot = waitFor(collection.whereIn("zip", asList(map("code", 500))).get()); |
| 451 | + snapshot = waitFor(collection.whereIn("zip", asList(map("code", 500L))).get()); |
451 | 452 | assertEquals(asList(docF), querySnapshotToValues(snapshot));
|
452 | 453 | }
|
453 | 454 |
|
454 |
| - // TODO(in-queries): Re-enable once emulator support is added to travis. |
| 455 | + // TODO(in-queries): Re-enable in prod once feature lands in backend. |
455 | 456 | @Test
|
456 |
| - @Ignore |
457 | 457 | public void testQueriesCanUseArrayContainsAnyFilters() {
|
| 458 | + Assume.assumeTrue(isRunningAgainstEmulator()); |
458 | 459 | Map<String, Object> docA = map("array", asList(42L));
|
459 | 460 | Map<String, Object> docB = map("array", asList("a", 42L, "c"));
|
460 | 461 | Map<String, Object> docC = map("array", asList(41.999, "42", map("a", asList(42))));
|
|
0 commit comments