add tests for endpoint selection