Skip to content

Commit 766f99a

Browse files
committed
SpecTestCase.java: update to handle targetPurpose as a string, not an integer
1 parent e1ac631 commit 766f99a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,15 @@ private Query parseQuery(Object querySpec) throws JSONException {
421421
}
422422

423423
private static QueryPurpose parseQueryPurpose(Object value) {
424-
if (!(value instanceof Integer)) {
424+
if (!(value instanceof String)) {
425425
throw new IllegalArgumentException("invalid query purpose: " + value);
426426
}
427-
switch ((Integer) value) {
428-
case 0:
427+
switch ((String) value) {
428+
case "TargetPurposeListen":
429429
return QueryPurpose.LISTEN;
430-
case 1:
430+
case "TargetPurposeExistenceFilterMismatch":
431431
return QueryPurpose.EXISTENCE_FILTER_MISMATCH;
432-
case 3:
432+
case "TargetPurposeLimboResolution":
433433
return QueryPurpose.LIMBO_RESOLUTION;
434434
default:
435435
throw new IllegalArgumentException("unknown query purpose value: " + value);

0 commit comments

Comments
 (0)