11package com.mapk.krowmapper
22
33import com.google.common.base.CaseFormat
4- import javax.sql.DataSource
54import org.h2.jdbcx.JdbcDataSource
65import org.junit.jupiter.api.AfterAll
76import org.junit.jupiter.api.Assertions.assertEquals
@@ -12,6 +11,7 @@ import org.junit.jupiter.api.TestInstance
1211import org.springframework.jdbc.core.JdbcTemplate
1312import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource
1413import org.springframework.jdbc.core.simple.SimpleJdbcInsert
14+ import javax.sql.DataSource
1515
1616@TestInstance(TestInstance .Lifecycle .PER_CLASS )
1717@DisplayName(" DBを用いてマッピングを行うテスト" )
@@ -61,7 +61,8 @@ class UseDBMappingTest {
6161
6262 jdbcTemplate = JdbcTemplate (dataSource)
6363
64- jdbcTemplate.execute("""
64+ jdbcTemplate.execute(
65+ """
6566 CREATE TABLE IF NOT EXISTS `foo_table` (
6667 `foo_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
6768 `foo_name` VARCHAR(255) NOT NULL,
@@ -70,7 +71,8 @@ class UseDBMappingTest {
7071 `description` VARCHAR(1023) NULL DEFAULT NULL,
7172 PRIMARY KEY (`foo_id`)
7273 );
73- """ .trimIndent())
74+ """ .trimIndent()
75+ )
7476
7577 val data = FooInsert (10 , " Foo" , FooStatus .archive, false , null )
7678
@@ -79,9 +81,10 @@ class UseDBMappingTest {
7981
8082 @Test
8183 fun test () {
82- val result = jdbcTemplate.query(" SELECT * FROM foo_table" , KRowMapper ((Foo )::fooFactory) {
83- CaseFormat .LOWER_CAMEL .to(CaseFormat .LOWER_UNDERSCORE , it)
84- }).single()
84+ val result = jdbcTemplate.query(
85+ " SELECT * FROM foo_table" ,
86+ KRowMapper ((Foo )::fooFactory) { CaseFormat .LOWER_CAMEL .to(CaseFormat .LOWER_UNDERSCORE , it) }
87+ ).single()
8588
8689 assertEquals(
8790 Foo (10 , " Foo" , FooStatus .archive, false , null ),
0 commit comments