Fix tests only - fix tests for SqlServer

This commit is contained in:
Rob Bygrave committed 2021-09-23 17:07:35 +12:00
1 parent 3244314424
commit e8524c5b1a
3 files changed
+20 -8

No files matched your search

@@ -66,8 +66,11 @@ public class TestQueryForUpdate extends BaseTestCase {
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(2);
assertThat(sql.get(0)).contains("from o_order");
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
if (isSqlServer()) {
assertThat(sql.get(1)).contains("from o_customer t0 with (updlock) where t0.id = ?");
} else {
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
}
transaction.commit();
}
}
@@ -98,8 +101,11 @@ public class TestQueryForUpdate extends BaseTestCase {
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(2);
assertThat(sql.get(0)).contains("from o_order");
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
if (isSqlServer()) {
assertThat(sql.get(1)).contains("from o_customer t0 with (updlock,nowait) where t0.id = ?");
} else {
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
}
transaction.commit();
}
}