my Play using mysql in production. But I am trying to use memory for testing.
I created 2 conf file, 1 is application.conf, the other is application.test.conf (in the same directory).
I tried to do
play -Dconfig.file=conf/application.test.conf test-only
But it still use the default conf file. I'm just wonder if anyone know how to use a different conf file during testing. (or at least use a different database setting during testing).
If you mean for unit tests then just add
running(FakeApplication(additionalConfiguration = inMemoryDatabase())) { Test code... }
to your tests and they will be done in memory. No need to change conf files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With