diff --git a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java index 2d3b118a5bdb..8b9be3395ce3 100644 --- a/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java +++ b/google-cloud-clients/google-cloud-firestore/src/test/java/com/google/cloud/firestore/ConformanceTest.java @@ -331,11 +331,19 @@ public int compare(QueryDocumentSnapshot o1, QueryDocumentSnapshot o2) { } /** Helper function to convert test values in a list to Firestore API types. */ - private List convertArray(List list) { - for (int i = 0; i < list.size(); ++i) { - list.set(i, convertValue(list.get(i))); + private Object convertArray(List list) { + if (!list.isEmpty() && list.get(0).equals("ArrayUnion")) { + return FieldValue.arrayUnion( + ((List) convertArray(list.subList(1, list.size()))).toArray()); + } else if (!list.isEmpty() && list.get(0).equals("ArrayRemove")) { + return FieldValue.arrayRemove( + ((List) convertArray(list.subList(1, list.size()))).toArray()); + } else { + for (int i = 0; i < list.size(); ++i) { + list.set(i, convertValue(list.get(i))); + } + return list; } - return list; } /** Reads the test definition from the Proto file. */ diff --git a/google-cloud-clients/google-cloud-firestore/src/test/resources/test-suite.binproto b/google-cloud-clients/google-cloud-firestore/src/test/resources/test-suite.binproto index c3a4962d0cf4..1bfc0ca48f12 100644 Binary files a/google-cloud-clients/google-cloud-firestore/src/test/resources/test-suite.binproto and b/google-cloud-clients/google-cloud-firestore/src/test/resources/test-suite.binproto differ