Add tests for send_to_endpoint.