@@ -613,53 +613,41 @@ public void testQueriesCanUseArrayContainsAnyFilters() {
613
613
FirebaseFirestore db = collection .firestore ;
614
614
615
615
// Search for "array" to contain [42, 43].
616
- PipelineSnapshot snapshot =
617
- waitFor (
618
- db .pipeline ()
619
- .convertFrom (collection .whereArrayContainsAny ("array" , asList (42L , 43L )))
620
- .execute ());
616
+ Pipeline pipeline = db .pipeline ()
617
+ .convertFrom (collection .whereArrayContainsAny ("array" , asList (42L , 43L )));
618
+ PipelineSnapshot snapshot = waitFor (pipeline .execute ());
621
619
assertEquals (asList (docA , docB , docD , docE ), pipelineSnapshotToValues (snapshot ));
622
620
623
621
// With objects.
624
- snapshot =
625
- waitFor (
626
- db .pipeline ()
627
- .convertFrom (collection .whereArrayContainsAny ("array" , asList (map ("a" , 42L ))))
628
- .execute ());
622
+ pipeline = db .pipeline ()
623
+ .convertFrom (collection .whereArrayContainsAny ("array" , asList (map ("a" , 42L ))));
624
+ snapshot = waitFor (pipeline .execute ());
629
625
assertEquals (asList (docF ), pipelineSnapshotToValues (snapshot ));
630
626
631
627
// With null.
632
- snapshot =
633
- waitFor (
634
- db .pipeline ()
635
- .convertFrom (collection .whereArrayContainsAny ("array" , nullList ()))
636
- .execute ());
628
+ pipeline = db .pipeline ()
629
+ .convertFrom (collection .whereArrayContainsAny ("array" , nullList ()));
630
+ snapshot = waitFor (pipeline .execute ());
637
631
assertEquals (new ArrayList <>(), pipelineSnapshotToValues (snapshot ));
638
632
639
633
// With null and a value.
640
634
List <Object > inputList = nullList ();
641
635
inputList .add (43L );
642
- snapshot =
643
- waitFor (
644
- db .pipeline ()
645
- .convertFrom (collection .whereArrayContainsAny ("array" , inputList ))
646
- .execute ());
636
+ pipeline = db .pipeline ()
637
+ .convertFrom (collection .whereArrayContainsAny ("array" , inputList ));
638
+ snapshot = waitFor (pipeline .execute ());
647
639
assertEquals (asList (docE ), pipelineSnapshotToValues (snapshot ));
648
640
649
641
// With NaN.
650
- snapshot =
651
- waitFor (
652
- db .pipeline ()
653
- .convertFrom (collection .whereArrayContainsAny ("array" , asList (Double .NaN )))
654
- .execute ());
642
+ pipeline = db .pipeline ()
643
+ .convertFrom (collection .whereArrayContainsAny ("array" , asList (Double .NaN )));
644
+ snapshot = waitFor (pipeline .execute ());
655
645
assertEquals (new ArrayList <>(), pipelineSnapshotToValues (snapshot ));
656
646
657
647
// With NaN and a value.
658
- snapshot =
659
- waitFor (
660
- db .pipeline ()
661
- .convertFrom (collection .whereArrayContainsAny ("array" , asList (Double .NaN , 43L )))
662
- .execute ());
648
+ pipeline = db .pipeline ()
649
+ .convertFrom (collection .whereArrayContainsAny ("array" , asList (Double .NaN , 43L )));
650
+ snapshot = waitFor (pipeline .execute ());
663
651
assertEquals (asList (docE ), pipelineSnapshotToValues (snapshot ));
664
652
}
665
653
0 commit comments