A generic helper for database related tests with play 2 and JPA

Posted by Jens Jäger on December 31, 2013

All your database related unit tests for a play 2 java application have to handle the fakeApplication startup, load an fresh in memory database and load the test related fixtures. You need fixy and this helper to do the trick:

To use the helper you just have to extend from ModelTest and override the fixturesToLoad method:

The tasks.yaml loaded in fixturesToLoad must be placed in the conf/fixtures folder of the play application.

The source code is pushed to Play4Jpa repo on github.


Use this link to trackback from your own site.


Leave a response


Information about Data protection