lundi 21 décembre 2015

Setup for inMemory DB for unit testing of Repository classes in Play 2.4 with Anorm 2.4

I am continuing my learning curve on Play, and one of the problems that I faced with is unit testing of repository classes. The way I used to do it in other frameworks, is by separating data access logic into Repository classes and testing them in isolation with in memory databases. For the rest of tests, I was usually mocking the repo classes.

This approach is described here at a very high level: http://ift.tt/1YsNqdi

Now, I am trying to figure out how to setup a unit test of repository class with in memory database. The only documentation I was able to find related to this topic is this: http://ift.tt/1B0Trmo

Being a very fresh in play & scala, I was trying to find a simple example of how to set it up, but after spending hours on this, decided to post this question. Is there any simple example of unit test using inMemory DB in test context for Play & Anorm?

Thanks,

Aucun commentaire:

Enregistrer un commentaire