Extract `mock_connection` from `session-test.cpp`