Refactor tests using assertSql() helper method

This helper method trims column alias from the sql (for Oracle)
This commit is contained in:
rob bygrave
2020-02-20 15:08:43 +13:00
parent 78b9066345
commit de42655bbd
123 changed files with 767 additions and 743 deletions
@@ -45,11 +45,11 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
assertThat(sql).hasSize(1);
if (isPlatformSupportsDeleteTableAlias()) {
assertThat(sql.get(0)).contains("delete from euser_no_fk t0 where not exists (select 1 from efile_no_fk x where x.owner_user_id = t0.user_id)");
assertSql(sql.get(0)).contains("delete from euser_no_fk t0 where not exists (select 1 from efile_no_fk x where x.owner_user_id = t0.user_id)");
} else if (isMySql()) {
assertThat(sql.get(0)).contains("delete t0 from euser_no_fk t0 where not exists (select 1 from efile_no_fk x where x.owner_user_id = t0.user_id)");
assertSql(sql.get(0)).contains("delete t0 from euser_no_fk t0 where not exists (select 1 from efile_no_fk x where x.owner_user_id = t0.user_id)");
} else {
assertThat(sql.get(0)).contains("delete from euser_no_fk where not exists (select 1 from efile_no_fk x where x.owner_user_id = user_id)");
assertSql(sql.get(0)).contains("delete from euser_no_fk where not exists (select 1 from efile_no_fk x where x.owner_user_id = user_id)");
}
}