I have a Play2 application that needs to call external services. I would like to test that I can connect to these services and get the expected answers.
The problem is that the WS API only returns a promise of result. This is nice, as it frees me from explicitly doing the request from an actor. But I do not know how to test it.
Is there a way to either:
- Ask for the promise to block until it is satisfied, or
- schedule asynchronous tests in Play2?
I found that I can wait for the result of a
Promisewith theawaitmethod, so my test looks like