This test is too weird. It is using internal classes and also asserting the SQL result. We should only use public methods and assert the result instead of the SQL.