Saturday, 24 August 2013

Using H2 database for integration testing in Grails

Using H2 database for integration testing in Grails

My understanding is by default Grails using the H2 embedded database for
testing. My Datasource.groovy configures a local Postgres database as a
root datasoure
dataSource {
driverClassName = "org.postgresql.Driver"
dialect = org.hibernate.dialect.PostgreSQLDialect
url = ...
pooled = true
...
But I don't want this used in integration testing. I would prefer to use
the H2 embedded option. So how do I override this for integration test
environment and make it use embedded H2 database?
Thanks

No comments:

Post a Comment