@@ -563,6 +563,18 @@ public void testWhereWithinKilometers() throws Exception {
563563 verifyCondition (query , "key" , "$maxDistance" , 100.0 / ParseGeoPoint .EARTH_MEAN_RADIUS_KM );
564564 }
565565
566+ @ Test
567+ public void testClear () throws Exception {
568+ ParseQuery <ParseObject > query = new ParseQuery <>("Test" );
569+ query .whereEqualTo ("key" , "value" );
570+ query .whereEqualTo ("otherKey" , "otherValue" );
571+ verifyCondition (query , "key" , "value" );
572+ verifyCondition (query , "otherKey" , "otherValue" );
573+ query .clear ("key" );
574+ verifyCondition (query , "key" , null );
575+ verifyCondition (query , "otherKey" , "otherValue" ); // still.
576+ }
577+
566578 @ Test
567579 public void testOr () throws Exception {
568580 ParseQuery <ParseObject > query = new ParseQuery <>("Test" );
@@ -684,6 +696,13 @@ public void testSkip() throws Exception {
684696 assertEquals (5 , query .getSkip ());
685697 }
686698
699+ private static void verifyCondition (ParseQuery query , String key , Object value ) {
700+ // We generate a state to verify the content of the builder
701+ ParseQuery .State state = query .getBuilder ().build ();
702+ ParseQuery .QueryConstraints queryConstraints = state .constraints ();
703+ assertEquals (value , queryConstraints .get (key ));
704+ }
705+
687706 private static void verifyCondition (
688707 ParseQuery query , String key , String conditionKey , Object value ) {
689708 // We generate a state to verify the content of the builder
0 commit comments