Refactoring ConnectionTest