December 31, 2013

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


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.


fixy, Java, JPA, ModelTest, Play Framework, Play4JPA, Unittest

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked

Information about Data protection

This site uses Akismet to reduce spam. Learn how your comment data is processed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}