title: play framework use in memory h2 database for unit tests
body: <p>I am trying to configure my play framework application so that it uses a mysql database when running and a in memory database for the tests.
  When I run the tests it connects to the mysql database and not the in memory database.
  Anyone know why?</p>
  
  <p>This is my config:</p>
  
  <pre><code>db.default.driver=com.mysql.jdbc.Driver
  db.default.url="jdbc:mysql://localhost/communityRoots?characterEncoding=UTF-8"
  db.default.user=root
  db.default.password= ""
  
  db.test.driver=org.h2.Driver
  db.test.url="jdbc:h2:mem:play;MODE=MYSQL"
  db.test.user=sa
  db.test.password=""
  </code></pre>
  
  <p>this is my test:</p>
  
  <pre><code>running(fakeApplication(inMemoryDatabase("test")), new Runnable() {
          public void run() {
              new User("bob@gmail.com", "Bob", "secret").save();
              assertNotNull(User.authenticate("bob@gmail.com", "secret"));
              assertNull(User.authenticate("bob@gmail.com", "badpassword"));
              assertNull(User.authenticate("tom@gmail.com", "secret"));
          }
      });
  </code></pre>