Skip to content

Commit cb5f9d6

Browse files
fix: Improve error messages in tests (#1855)
* Better failure message. * chore: generate libraries at Mon Sep 30 15:12:53 UTC 2024 * Pretty --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
1 parent 593acc3 commit cb5f9d6

File tree

1 file changed

+6
-5
lines changed
  • google-cloud-firestore/src/test/java/com/google/cloud/firestore

1 file changed

+6
-5
lines changed

google-cloud-firestore/src/test/java/com/google/cloud/firestore/WatchTest.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
import static com.google.cloud.firestore.LocalFirestoreHelper.UPDATED_FIELD_PROTO;
2525
import static com.google.cloud.firestore.LocalFirestoreHelper.map;
2626
import static com.google.cloud.firestore.LocalFirestoreHelper.string;
27+
import static org.junit.Assert.assertArrayEquals;
2728
import static org.junit.Assert.assertEquals;
2829
import static org.junit.Assert.assertFalse;
2930
import static org.junit.Assert.assertNotEquals;
3031
import static org.junit.Assert.assertNotNull;
31-
import static org.junit.Assert.assertTrue;
3232
import static org.mockito.Mockito.*;
3333

3434
import com.google.api.gax.grpc.GrpcStatusCode;
@@ -169,10 +169,11 @@ public void before() {
169169

170170
@After
171171
public void after() {
172-
assertTrue(exceptions.isEmpty());
173-
assertTrue(requests.isEmpty());
174-
assertTrue(documentSnapshots.isEmpty());
175-
assertTrue(querySnapshots.isEmpty());
172+
Object[] emptyArray = new Object[0];
173+
assertArrayEquals(exceptions.toArray(), emptyArray);
174+
assertArrayEquals(requests.toArray(), emptyArray);
175+
assertArrayEquals(documentSnapshots.toArray(), emptyArray);
176+
assertArrayEquals(querySnapshots.toArray(), emptyArray);
176177
listenerRegistration.remove();
177178
}
178179

0 commit comments

Comments
 (0)