Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-andersen committed Nov 8, 2023
1 parent d115f87 commit 477526d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public final class FirestoreSpy {
streamRequestBidiStreamObserverCaptor;

public FirestoreSpy(Firestore firestore) {
spy = Mockito.spy((FirestoreImpl) firestore);
final FirestoreImpl firestoreImpl = (FirestoreImpl) firestore;
spy = Mockito.spy(firestoreImpl);
streamRequestBidiStreamObserverCaptor = ArgumentCaptor.forClass(BidiStreamObserver.class);
doCallRealMethod()
.when(spy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,12 @@ public void restartAfterFailedFilter() throws Exception {
.modifiedIdsIsEmpty()
.removedIdsIsEmpty();
listener.lastDocumentIdsIsAnyOf("doc1", "doc2");
BidiStreamObserver<ListenRequest, ListenResponse> watch =
firestoreSpy.streamRequestBidiStreamObserverCaptor.getValue();

// Trigger existence filter mismatch, thereby invoking retry behavior.
// Prompting Firestore to send filter mismatch is difficult, so we hack
// in the response. All we are concerned about is invoking retry.
BidiStreamObserver<ListenRequest, ListenResponse> watch =
firestoreSpy.streamRequestBidiStreamObserverCaptor.getValue();
watch.onResponse(filter(0));

setDocument("doc3", map("foo", "bar"));
Expand Down

0 comments on commit 477526d

Please sign in to comment.