vendredi 3 juin 2016

Complete unit testing example in play framework + DI

I am looking for complete example of unit test for play 2.4 application + DI. The idea is very simple:

  1. We have application.test.conf from which I want to read the configuration data, run evolutions etc.
  2. Then I want to inject instance of class which uses DI, example:

    class UserBean @Inject()(dbConfigProvider: DatabaseConfigProvider, implicit val configuration: Configuration, cacheApi: CacheApi) {

    }

  3. Then call methods of injected object and test it.

The problem that I faced described here: Inject my bean-like class to test play 2.4 but nobody answers my question. Appreciate any help

Aucun commentaire:

Enregistrer un commentaire