Awaitility

http://code.google.com/p/awaitility/

Testing with Fluent APIs

The more tests I write, the more love I feel towards fluent interfaces :) I hope to write someday soon more about Test Data Builders and FEST assertions, but for now only a short list of useful fluent APIs that can help you write nice(r) tests:

 

A Glimpse of Awaitility

Today I had a task to first deploy a webapp and then verify whether it was properly deployed. Obviously there are things to consider:

  • it takes time till the app is deployed and started,
  • it is hard to say how long it takes.

One solution would be to wait for some safe time (2 minutes? 3 minutes?) and then check if the app responds to requests. Yes, but it would be definitely more efficient to do it in some kind of a loop, so you do not waste too much time if, for example, everything is up and ready in 1 minute 20 seconds.

 
Please comment using
 
Syndicate content