Skip to content

Commit 5b39f47

Browse files
committed
Update test which enshrined incorrect behaviour
After a pong timeout, the client should reconnect, not become disconnected. However, the test that the underlying connection is closed is correct.
1 parent 3fee52c commit 5b39f47

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/test/java/com/pusher/client/connection/websocket/WebSocketConnectionTest.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,21 +298,13 @@ public void testDisconnectInDisconnectingStateIsIgnored() {
298298
}
299299

300300
@Test
301-
public void testPongTimeoutResultsInDisconnect() throws InterruptedException {
301+
public void testPongTimeoutResultsInClosingConnection() throws InterruptedException {
302302
when(factory.getTimers()).thenReturn(new ScheduledThreadPoolExecutor(2));
303303

304304
connection.connect();
305305
connection.onMessage(CONN_ESTABLISHED_EVENT);
306306

307307
verify(mockUnderlyingConnection, timeout((int) (ACTIVITY_TIMEOUT + PONG_TIMEOUT))).close();
308-
309-
verify(mockEventListener).onConnectionStateChange(
310-
new ConnectionStateChange(ConnectionState.CONNECTED, ConnectionState.DISCONNECTING));
311-
312-
verify(mockEventListener).onConnectionStateChange(
313-
new ConnectionStateChange(ConnectionState.DISCONNECTING, ConnectionState.DISCONNECTED));
314-
315-
assertEquals(ConnectionState.DISCONNECTED, connection.getState());
316308
}
317309

318310
@Test

0 commit comments

Comments
 (0)