Fix issue with objectManager references in test helper
Add conditional compilation around `connectionTestExpectation` to avoid unused variable warning