11
11
import org .junit .jupiter .api .extension .ParameterResolutionException ;
12
12
import org .junit .jupiter .api .extension .ParameterResolver ;
13
13
import org .seasar .doma .jdbc .Config ;
14
- import org .seasar .doma .jdbc .dialect .H2Dialect ;
15
- import org .seasar .doma .jdbc .tx .LocalTransactionDataSource ;
14
+ import org .seasar .doma .jdbc .SimpleConfig ;
16
15
import org .seasar .doma .jdbc .tx .LocalTransactionManager ;
17
16
import org .seasar .doma .slf4j .Slf4jJdbcLogger ;
18
17
@@ -24,16 +23,15 @@ public class TestEnvironment
24
23
ParameterResolver {
25
24
26
25
private final LocalTransactionManager transactionManager ;
27
- private final Config config ;
26
+ private final SimpleConfig config ;
28
27
private final AppDao appDao ;
29
28
30
29
public TestEnvironment () {
31
- var dialect = new H2Dialect ();
32
- var dataSource =
33
- new LocalTransactionDataSource ("jdbc:h2:mem:tutorial;DB_CLOSE_DELAY=-1" , "sa" , null );
34
- var jdbcLogger = new Slf4jJdbcLogger ();
35
- transactionManager = new LocalTransactionManager (dataSource , jdbcLogger );
36
- config = new DbConfig (dialect , dataSource , jdbcLogger , transactionManager );
30
+ config =
31
+ SimpleConfig .builder ("jdbc:h2:mem:tutorial;DB_CLOSE_DELAY=-1" , "sa" , null )
32
+ .jdbcLogger (new Slf4jJdbcLogger ())
33
+ .build ();
34
+ transactionManager = config .getLocalTransactionManager ();
37
35
appDao = new AppDaoImpl (config );
38
36
}
39
37
0 commit comments