2
我有一個Wicket面板,它有AbstractAjaxTimeBehavior,我想單元測試。在單元測試期間,如何觸發ajax事件,最終調用AbstractAjaxTimeBehavior
的.onTimer(AjaxRequestTarget target)
方法?如何使用AbstractAjaxTimerBehavior對Wicket組件進行單元測試?
behavior = new AbstractAjaxTimerBehavior(Duration.seconds(pollingPeriodInSeconds)) {
protected void onTimer(AjaxRequestTarget target) {
// how to unit test this?
}
}
add(behavior);