Skip to content

Commit b8148ec

Browse files
feat: Convert internal interfaces to use protos
1 parent c14b41b commit b8148ec

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

google-cloud-pubsublite/src/test/java/com/google/cloud/pubsublite/internal/wire/ConnectedCommitterImplTest.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,18 @@ public void commitResponseProxied() {
224224

225225
@Test
226226
public void receiveTimeout_closesConnection() throws Exception {
227-
CountDownLatch connectionClosed = new CountDownLatch(1);
227+
CountDownLatch requestClosed = new CountDownLatch(1);
228228
doAnswer(
229229
args -> {
230-
connectionClosed.countDown();
230+
requestClosed.countDown();
231+
return null;
232+
})
233+
.when(mockRequestStream)
234+
.closeSendWithError(any());
235+
CountDownLatch outputClosed = new CountDownLatch(1);
236+
doAnswer(
237+
args -> {
238+
outputClosed.countDown();
231239
return null;
232240
})
233241
.when(mockOutputStream)
@@ -245,7 +253,8 @@ public void receiveTimeout_closesConnection() throws Exception {
245253
verify(mockRequestStream).send(initialRequest());
246254

247255
// No subsequent stream responses should close the stream.
248-
assertThat(connectionClosed.await(30, SECONDS)).isTrue();
256+
assertThat(requestClosed.await(30, SECONDS)).isTrue();
257+
assertThat(outputClosed.await(30, SECONDS)).isTrue();
249258

250259
verify(mockRequestStream).closeSendWithError(argThat(new ApiExceptionMatcher(Code.ABORTED)));
251260
verify(mockOutputStream).onError(argThat(new ApiExceptionMatcher(Code.ABORTED)));

0 commit comments

Comments
 (0)