Use new features from JUnit Jupiter 5.11

This commit primarily migrates to the new argumentSet() feature but also
applies additional polishing to our use of parameterized tests.

See gh-33395
This commit is contained in:
Sam Brannen
2024-08-16 13:48:19 +02:00
parent 2eff5cb463
commit d749d2949d
23 changed files with 173 additions and 165 deletions

View File

@@ -218,14 +218,14 @@ class StatementCreatorUtilsTests {
verify(preparedStatement).setTimestamp(1, new java.sql.Timestamp(cal.getTime().getTime()), cal);
}
@ParameterizedTest
@ParameterizedTest(name = "{0} -> {1}")
@MethodSource("javaTimeTypes")
public void testSetParameterValueWithJavaTimeTypes(Object o, int sqlType) throws SQLException {
StatementCreatorUtils.setParameterValue(preparedStatement, 1, sqlType, o);
verify(preparedStatement).setObject(1, o, sqlType);
}
@ParameterizedTest
@ParameterizedTest(name = "{0} -> {1}")
@MethodSource("javaTimeTypes")
void javaTimeTypesToSqlParameterType(Object o, int expectedSqlType) {
assertThat(StatementCreatorUtils.javaTypeToSqlParameterType(o.getClass()))