InsertOperationIT.testExecute_withDefaultValueNotNullColumnTurningNull_appliesDefaultOnSecondRow gates itself to HSQLDB only, since DEFAULT_VALUE_TABLE is defined solely in the HSQLDB fixture DDL, via an inline runtime check:
Assumptions.assumeTrue(
_connection.getConnection().getMetaData()
.getDatabaseProductName().startsWith("HSQL"),
"Skip: DEFAULT_VALUE_TABLE is only defined in the HSQLDB fixture DDL.");
This codebase already has a cleaner, declarative way to express "this test only runs against database X": JUnit 5's @EnabledIfSystemProperty(named = "dbunit.profile", matches = "..."), already used at the class level in InsertIdentityOperationIT, PostgresqlUuidIT, PostgresSQLOidIT, and SQLHelperDomainPostgreSQLIT.
Replace the inline check with a method-level @EnabledIfSystemProperty(named = "dbunit.profile", matches = "hsqldb") annotation on the one affected test method, and drop the now-unused Assumptions import.
Found while surveying the codebase for the same in-test special-case-logic anti-pattern addressed in #831/PR #834 (there, ad-hoc exception-catching and runtime capability checks were replaced with declarative dbunit.profile.unsupportedFeatures / TestFeature config). This one doesn't fit that exact mechanism since it's an inclusion check (only-HSQLDB) rather than an exclusion list, but the underlying goal - replacing an inline runtime database check with declarative JUnit config - is the same.
InsertOperationIT.testExecute_withDefaultValueNotNullColumnTurningNull_appliesDefaultOnSecondRowgates itself to HSQLDB only, sinceDEFAULT_VALUE_TABLEis defined solely in the HSQLDB fixture DDL, via an inline runtime check:This codebase already has a cleaner, declarative way to express "this test only runs against database X": JUnit 5's
@EnabledIfSystemProperty(named = "dbunit.profile", matches = "..."), already used at the class level inInsertIdentityOperationIT,PostgresqlUuidIT,PostgresSQLOidIT, andSQLHelperDomainPostgreSQLIT.Replace the inline check with a method-level
@EnabledIfSystemProperty(named = "dbunit.profile", matches = "hsqldb")annotation on the one affected test method, and drop the now-unusedAssumptionsimport.Found while surveying the codebase for the same in-test special-case-logic anti-pattern addressed in #831/PR #834 (there, ad-hoc exception-catching and runtime capability checks were replaced with declarative
dbunit.profile.unsupportedFeatures/TestFeatureconfig). This one doesn't fit that exact mechanism since it's an inclusion check (only-HSQLDB) rather than an exclusion list, but the underlying goal - replacing an inline runtime database check with declarative JUnit config - is the same.