Modified MockConnection() and its usage