mercredi 3 juin 2015

Play 2.3.x: Disable database connection during tests (specs2)

I'm getting mad with a simple problem, during testing in Play with specs2.

How can I disable, for some test classes, database connection ? More specific case:

I've got test classes, where unit testing doesn't need the DB, so no need to connect. How can I do this ? Modify .conf file ? Disabling plugins ?

The problem is: Configuration error[Cannot connect to database [foo]] I've got this error on 9/10 tests of my test class. The first test is ok.

Or am I missing something ?

EDIT: precision -> I want to disable MySQL connection, and MongoDB connection (with ReactiveMongo Plugin)

Aucun commentaire:

Enregistrer un commentaire