@@ -294,7 +294,8 @@ public void mysql() throws Exception {
294294 public void dbspecific () throws Exception {
295295 Config config = ConfigFactory .parseResources (getClass (), "jdbc.conf" );
296296 Config dbconf = config .withValue ("db.url" ,
297- ConfigValueFactory .fromAnyRef ("jdbc:mysql://localhost/db?useEncoding=true&characterEncoding=UTF-8" ))
297+ ConfigValueFactory
298+ .fromAnyRef ("jdbc:mysql://localhost/db?useEncoding=true&characterEncoding=UTF-8" ))
298299 .withValue ("application.charset" , fromAnyRef ("UTF-8" ))
299300 .withValue ("application.name" , fromAnyRef ("jdbctest" ))
300301 .withValue ("application.tmpdir" , fromAnyRef ("target" ))
@@ -303,7 +304,8 @@ public void dbspecific() throws Exception {
303304 .resolve ();
304305
305306 new MockUnit (Env .class , Config .class , Binder .class )
306- .expect (props ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource" , "jdbc:mysql://localhost/db?useEncoding=true&characterEncoding=UTF-8" ,
307+ .expect (props ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource" ,
308+ "jdbc:mysql://localhost/db?useEncoding=true&characterEncoding=UTF-8" ,
307309 "mysql.db" , null , "" , false ))
308310 .expect (mysql )
309311 .expect (unit -> {
@@ -385,24 +387,28 @@ public void overrideDataSource() throws Exception {
385387 @ Test
386388 public void twoDatabases () throws Exception {
387389 Config config = ConfigFactory .parseResources (getClass (), "jdbc.conf" );
388- Config dbconf = config .withValue ("db.audit" , ConfigValueFactory .fromAnyRef ("fs" ))
390+ Config dbconf = config .withValue ("db.audit.url" ,
391+ ConfigValueFactory .fromAnyRef ("jdbc:h2:mem:audit;DB_CLOSE_DELAY=-1" ))
389392 .withValue ("application.name" , fromAnyRef ("jdbctest" ))
390393 .withValue ("application.tmpdir" , fromAnyRef ("target" ))
391394 .withValue ("application.charset" , fromAnyRef ("UTF-8" ))
392- .withValue ("hikari.audit.dataSourceClassName" , fromAnyRef ("test.MyDataSource" ))
395+ .withValue ("db.audit.user" , fromAnyRef ("sa" ))
396+ .withValue ("db.audit.password" , fromAnyRef ("" ))
397+ .withValue ("db.audit.hikari.dataSourceClassName" , fromAnyRef ("test.MyDataSource" ))
393398 .resolve ();
394399
395400 new MockUnit (Env .class , Config .class , Binder .class )
396- .expect (props ("org.h2.jdbcx.JdbcDataSource" , "jdbc:h2:target/jdbctest" , "h2.jdbctest" ,
397- "sa" , "" , true ))
401+ .expect (
402+ props ("org.h2.jdbcx.JdbcDataSource" , "jdbc:h2:mem:audit;DB_CLOSE_DELAY=-1" , "h2.audit" ,
403+ "sa" , "" , true ))
398404 .expect (unit -> {
399405 Properties properties = unit .get (Properties .class );
400406 expect (properties .setProperty ("dataSourceClassName" , "test.MyDataSource" ))
401407 .andReturn (null );
402408 })
403409 .expect (hikariConfig ())
404410 .expect (hikariDataSource ())
405- .expect (serviceKey ("jdbctest " ))
411+ .expect (serviceKey ("audit " ))
406412 .expect (onStop )
407413 .run (unit -> {
408414 new Jdbc ("db.audit" ).configure (unit .get (Env .class ), dbconf , unit .get (Binder .class ));
0 commit comments