How to unit-test a Wicket component with AbstractAjaxTimerBehavior?
- by Juha Syrjälä
I have a Wicket panel that has AbstractAjaxTimeBehavior, that I'd like to unit test. How can I trigger a ajax event during the unit test that end up calling AbstractAjaxTimeBehavior's .onTimer(AjaxRequestTarget target) method?
behavior = new AbstractAjaxTimerBehavior(Duration.seconds(pollingPeriodInSeconds)) {
protected void onTimer(AjaxRequestTarget target) {
// how to unit test this?
}
}
add(behavior);