connection middleware test cases added