@Test
public void cacheIssueList() throws Exception {
new NonFacesRequest() {
protected void renderResponse() throws Exception {
JiraDAO dao = (JiraDAO)getInstance(JiraDAO.class);
List<JiraIssue> issues = dao.getJiraIssues("foo", "bar", "baz", "hum", 3);
assert issues.size() == 0; // Asynchronous cache needs to do its job first
Thread.sleep(1000);
issues = dao.getJiraIssues("foo", "bar", "baz", "hum", 3);
assert issues.size() == 0; // Still nothing
Thread.sleep(3000);
issues = dao.getJiraIssues("foo", "bar", "baz", "hum", 3);
assert issues.size() == 3; // Now we have it
}
}.run();
}