Testing asynchronous systems is hard. Not only does it require handling threads, timeouts and concurrency issues, but the intent of the test code can be obscured by all these details. Awaitility is a DSL that allows you to express expectations of an asynchronous system in a concise and easy to read manner. For example:
@Test
public void updatesCustomerStatus() throws Exception {
// Publish an asynchronous event:
publishEvent(updateCustomerStatusEvent);
// Awaitility lets you wait until the asynchronous operation completes:
await().atMost(5, SECONDS).until(customerStatusIsUpdated());
...
}
- 2015-07-20: Awaitility has moved to GitHub. From now on the old Google Code page should not be used anymore. All issues are reported here on GitHub and the documentation is migrated.
- 2014-11-28: Awaitility 1.6.3 is released. See change log for details.
- 2014-10-15: Awaitility 1.6.2 is released with improved support for Condition Evaluation Listeners, Groovy 2.3 Trait support and deadlock detection. See change log for more details.
- Change log
- Awaitility on Ohloh
- Mailing list for questions and support