Using an in-memory database for tests

You now have all the required knowledge to make your web service persistent. Once you have chosen a database technology, select the Play plugins you need (JDBC, JPA, and so on), configure your data sources right from your application.conf file, use the database helper classes provided by the plugins to integrate with your database technology, and finally implement your business layer on top of your database layer.

Once you have made your business layer persistent, you probably want to run your tests to check whether you introduced a regression. However, you will unexpectedly get the following error:

[info] A Shop should
[info] ! add items
[error] RuntimeException: : There is no started application (Play.scala:71) ...

Get Play Framework Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.