Refactor origin connection functional tests
Move the get query to a seprarate function to make adding future tests easy.