I have a Play application that defines three different connection configurations in conf/reference.conf
. When I run unit tests that require the use of FakeApplication
the BoneCP plugin automatically initializes these three connections even when the unit tests do not call any classes that use any database connections. It starts up and shuts down connections for every unit test. This causes unit tests to take forever to complete. Is there a way to lazily start database connections in BoneCP, HikariCP, or some other connection manager, only opening them when they're first used?
I could of course disable BoneCPPlugin altogether inside the relevant unit tests, but what if I have a unit tests that needs one of the connection configurations?