samedi 14 mars 2015

Is there any way to configure mongoPath for ManagedMongoDb in a property?

I have this integration test that tries to test a DAO.



public class WhenMultipleMessagesAreReceived {

@Value("${mongodb.location:/usr}")
static private String mongoDBLocation;

@ClassRule
public static ManagedMongoDb managedMongoDb = newManagedMongoDbRule().mongodPath(mongoDBLocation).build();

}


I would like to be able to configure "mongodb.location" in a properties file. Spring seems not be able to load properties in a static field but I don't have other choice because @ClassRule requires static fields.


Aucun commentaire:

Enregistrer un commentaire