Account account = (Account) getValue("#{selectedAccount}");
assert account !=null;
assert account.getId() == 1;
assert account.getPayments().size() == 1;
Payment payment = (Payment) getValue("#{newPayment}");
assert payment.getPayee().equals("IRS");
assert payment.getAmount().equals(new BigDecimal("100.00"));
assert payment.getAccount() != null;
assert payment.getAccount().getId() == 1;
quartzTriggerHandle = payment.getQuartzTriggerHandle();
}
}.run();
// Wait, let quartz execute the job (async but straight away)
pause(500);
new FacesRequest("/search.xhtml", id)
{
@Override
protected void beforeRequest()
{
setParameter("accountId", "1");
}
@Override
protected void renderResponse() throws Exception
{
assert ((Boolean)getValue("#{accountHome.idDefined}"));
Account account = (Account) getValue("#{selectedAccount}");
assert account !=null;
assert account.getId() == 1;
assert account.getPayments().size() == 1;
Payment payment = account.getPayments().get(0);
assert new BigDecimal("100.00").equals(payment.getAmount());
assert !payment.getActive();
assert ONCE.equals(payment.getPaymentFrequency());
assert payment.getLastPaid() != null;
assert new BigDecimal("901.46").equals(account.getBalance());
}
}.run();
}