@Test
public void test_connection() {

    final EngineIoServer engineIoServer = new EngineIoServer();
    final SocketIoServer server = new SocketIoServer(engineIoServer);
    final SocketIoNamespace namespace = server.namespace("/");
    assertNotNull(namespace);
    final Emitter.Listener connectionListener = Mockito.mock(Emitter.Listener.class);
    namespace.on("connect", connectionListener);
    namespace.on("connection", connectionListener);
    engineIoServer.handleWebSocket(new EngineIoWebSocket() {
        @Override
        public Map<String, String> getQuery() {
            return new HashMap<>();
        }
        @Override
        public void write(String message) {
        }
        @Override
        public void write(byte[] message) {
        }
        @Override
        public void close() {
        }
    });
    Mockito.verify(connectionListener, Mockito.times(2))
            .call(Mockito.any(SocketIoSocket.class));
}