HHH-15668 Fix assertion in BatchOptimisticLockingTest

Recent CockroachDB versions return a more detailed message. We now
test only the first part of the error message.
This commit is contained in:
Karel Maesen 2022-11-23 22:25:02 +01:00 committed by Christian Beikov
parent 67d751d81d
commit 160f86a2f6
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,6 @@ import static org.junit.Assert.fail;
/**
* @author Vlad Mihalcea
*/
@SkipForDialect(value = CockroachDialect.class, comment = "See https://hibernate.atlassian.net/browse/HHH-15668")
public class BatchOptimisticLockingTest extends
BaseNonConfigCoreFunctionalTestCase {
@ -101,9 +100,10 @@ public class BatchOptimisticLockingTest extends
if ( getDialect() instanceof CockroachDialect ) {
// CockroachDB always runs in SERIALIZABLE isolation, and uses SQL state 40001 to indicate
// serialization failure.
var msg = "org.hibernate.exception.LockAcquisitionException: could not execute batch";
assertEquals(
"org.hibernate.exception.LockAcquisitionException: could not execute batch",
expected.getMessage()
expected.getMessage().substring( 0, msg.length() )
);
}
else if ( getDialect() instanceof OracleDialect && getDialect().getVersion().isBefore( 12 ) ) {