mardi 2 juin 2015

Unit testing Promise task in grails

How do we unit test logic in Promises.task?

task{service.method()} 

I want to validate invocation of the service method inside the task.

Is this possible? If yes, how?

I read in the documentation that in unit testing async processes, one can use this:

Promises.promiseFactory = new SynchronousPromiseFactory()

Tried adding it in my setup, but still does not work.

Aucun commentaire:

Enregistrer un commentaire