added build_connection_url function with unit tests