public void setUp() throws URISyntaxException, SSLException {
when(factory.getChannelManager()).thenReturn(mockChannelManager);
when(factory.newWebSocketClientWrapper(any(URI.class), any(WebSocketConnection.class)))
.thenReturn(mockUnderlyingConnection);
when(factory.getEventQueue()).thenReturn(new InstantExecutor());
when(factory.getTimers()).thenReturn(new DoNothingExecutor());
this.connection = new WebSocketConnection(URL, ACTIVITY_TIMEOUT, PONG_TIMEOUT, factory);
this.connection.bind(ConnectionState.ALL, mockEventListener);
}