refactor tests to reuse common connection setup