@Test
public void testConnectToSource() throws InterruptedException {

    client.webSocketFuture = CompletableFuture.completedFuture(true);
    client.authFuture = CompletableFuture.completedFuture(true);
    
    client.connectToSource();
    // Wait up to 5 seconds for asynchronous action to complete
    waitUntilTrue(5 * 1000, () -> socket.receivedMessage());
    
    assert socket.compareData("op", ExtensionServiceMessage.OP_CONNECT_EXTENSION);
    assert socket.compareData("resourceName", ExtensionServiceMessage.RESOURCE_NAME_SOURCES);
    assert socket.compareData("resourceId", srcName);
}