when(factory.getTimers()).thenReturn(new DoNothingExecutor());
when(factory.newWebSocketClientWrapper(any(URI.class), any(WebSocketListener.class))).thenAnswer(new Answer<WebSocketClientWrapper>() {
@Override
public WebSocketClientWrapper answer(InvocationOnMock invocation) throws Throwable {
URI uri = (URI) invocation.getArguments()[0];
WebSocketListener proxy = (WebSocketListener) invocation.getArguments()[1];
testWebsocket = new TestWebSocketClientWrapper(uri, proxy);
return testWebsocket;
}
});