Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use other application.conf in tests than in prod code?

im trying to test PersistentActor with scalatest but I dont know how to point test code to use something like application-test.conf instead application.conf ( I want to change leveldb store for events to in memory store ). Is there any convenient way to do this?

like image 510
hi_my_name_is Avatar asked Dec 06 '22 15:12

hi_my_name_is


1 Answers

You could define another application.conf in your test resources:

src/test/resources/application.conf

This way, you can have test related configuration that will be used by default in your tests.

If you still require multiple configuration settings among your tests, you can always have more than one configuration file in the test resources and explicitly use the one you need:

class PersistentActorSpec extends TestKit(ActorSystem("test-system", ConfigFactory.load("application-test")))
like image 159
Bianca Tesila Avatar answered Mar 03 '23 02:03

Bianca Tesila