|
14 | 14 |
|
15 | 15 | package com.google.firebase.firestore;
|
16 | 16 |
|
17 |
| -import static com.google.firebase.firestore.Filter.and; |
18 |
| -import static com.google.firebase.firestore.Filter.equalTo; |
19 |
| -import static com.google.firebase.firestore.Filter.greaterThan; |
20 |
| -import static com.google.firebase.firestore.Filter.inArray; |
21 |
| -import static com.google.firebase.firestore.Filter.notInArray; |
22 |
| -import static com.google.firebase.firestore.Filter.or; |
23 | 17 | import static com.google.firebase.firestore.testutil.IntegrationTestUtil.nullList;
|
24 | 18 | import static com.google.firebase.firestore.testutil.IntegrationTestUtil.querySnapshotToIds;
|
25 | 19 | import static com.google.firebase.firestore.testutil.IntegrationTestUtil.querySnapshotToValues;
|
|
34 | 28 | import static org.junit.Assert.assertEquals;
|
35 | 29 | import static org.junit.Assert.assertFalse;
|
36 | 30 | import static org.junit.Assert.assertNull;
|
37 |
| -import static org.junit.Assert.assertThrows; |
38 | 31 | import static org.junit.Assert.assertTrue;
|
39 | 32 |
|
40 | 33 | import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
44 | 37 | import com.google.firebase.firestore.testutil.EventAccumulator;
|
45 | 38 | import com.google.firebase.firestore.testutil.IntegrationTestUtil;
|
46 | 39 | import java.util.ArrayList;
|
47 |
| -import java.util.Arrays; |
48 | 40 | import java.util.LinkedHashMap;
|
49 | 41 | import java.util.List;
|
50 | 42 | import java.util.Map;
|
@@ -372,72 +364,6 @@ public void testCanListenForQueryMetadataChanges() {
|
372 | 364 | listener2.remove();
|
373 | 365 | }
|
374 | 366 |
|
375 |
| - @Test |
376 |
| - public void testInvalidQueryFilters() { |
377 |
| - CollectionReference collection = testCollection(); |
378 |
| - // Multiple inequalities, one of which is inside a nested composite filter. |
379 |
| - assertThrows( |
380 |
| - IllegalArgumentException.class, |
381 |
| - () -> { |
382 |
| - Query query = |
383 |
| - collection |
384 |
| - .where( |
385 |
| - or( |
386 |
| - and(equalTo("a", "b"), greaterThan("c", "d")), |
387 |
| - and(equalTo("e", "f"), equalTo("g", "h")))) |
388 |
| - .where(greaterThan("r", "s")); |
389 |
| - }); |
390 |
| - // OrderBy and inequality on different fields. Inequality inside a nested composite filter. |
391 |
| - assertThrows( |
392 |
| - IllegalArgumentException.class, |
393 |
| - () -> { |
394 |
| - Query query = |
395 |
| - collection |
396 |
| - .where( |
397 |
| - or( |
398 |
| - and(equalTo("a", "b"), greaterThan("c", "d")), |
399 |
| - and(equalTo("e", "f"), equalTo("g", "h")))) |
400 |
| - .orderBy("r"); |
401 |
| - }); |
402 |
| - // Conflicting operations within a composite filter. |
403 |
| - assertThrows( |
404 |
| - IllegalArgumentException.class, |
405 |
| - () -> { |
406 |
| - Query query = |
407 |
| - collection.where( |
408 |
| - or( |
409 |
| - and(equalTo("a", "b"), inArray("c", Arrays.asList("d", "e"))), |
410 |
| - and(equalTo("e", "f"), notInArray("c", Arrays.asList("d", "e"))))); |
411 |
| - }); |
412 |
| - // Conflicting operations between a field filter and a composite filter. |
413 |
| - assertThrows( |
414 |
| - IllegalArgumentException.class, |
415 |
| - () -> { |
416 |
| - Query query = |
417 |
| - collection |
418 |
| - .where( |
419 |
| - or( |
420 |
| - and(equalTo("a", "b"), inArray("c", Arrays.asList("d", "e"))), |
421 |
| - and(equalTo("e", "f"), equalTo("g", "h")))) |
422 |
| - .where(notInArray("c", Arrays.asList("d", "e"))); |
423 |
| - }); |
424 |
| - // Conflicting operations between two composite filters. |
425 |
| - assertThrows( |
426 |
| - IllegalArgumentException.class, |
427 |
| - () -> { |
428 |
| - Query query = |
429 |
| - collection |
430 |
| - .where( |
431 |
| - or( |
432 |
| - and(equalTo("a", "b"), inArray("c", Arrays.asList("d", "e"))), |
433 |
| - and(equalTo("e", "f"), equalTo("g", "h")))) |
434 |
| - .where( |
435 |
| - or( |
436 |
| - and(equalTo("a", "b"), notInArray("c", Arrays.asList("d", "e"))), |
437 |
| - and(equalTo("e", "f"), equalTo("g", "h")))); |
438 |
| - }); |
439 |
| - } |
440 |
| - |
441 | 367 | @Test
|
442 | 368 | public void testCanExplicitlySortByDocumentId() {
|
443 | 369 | Map<String, Map<String, Object>> testDocs =
|
|
0 commit comments