|
|
|
@ -19,6 +19,8 @@ package org.springframework.jdbc.core;
@@ -19,6 +19,8 @@ package org.springframework.jdbc.core;
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
|
import org.junit.jupiter.params.provider.CsvSource; |
|
|
|
|
|
|
|
|
|
import org.springframework.beans.TypeMismatchException; |
|
|
|
|
import org.springframework.dao.InvalidDataAccessApiUsageException; |
|
|
|
@ -149,4 +151,18 @@ class BeanPropertyRowMapperTests extends AbstractRowMapperTests {
@@ -149,4 +151,18 @@ class BeanPropertyRowMapperTests extends AbstractRowMapperTests {
|
|
|
|
|
mock.verifyClosed(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
|
@CsvSource({ |
|
|
|
|
"age, age", |
|
|
|
|
"lastName, last_name", |
|
|
|
|
"Name, name", |
|
|
|
|
"FirstName, first_name", |
|
|
|
|
"EMail, e_mail", |
|
|
|
|
"URL, u_r_l", // likely undesirable, but that's the status quo
|
|
|
|
|
}) |
|
|
|
|
void underscoreName(String input, String expected) { |
|
|
|
|
BeanPropertyRowMapper<?> mapper = new BeanPropertyRowMapper<>(Object.class); |
|
|
|
|
assertThat(mapper.underscoreName(input)).isEqualTo(expected); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|