Thursday, 5 September 2013

WicketTester how to unit test AjaxFormComponentUpdatingBehavior onUpdate?

WicketTester how to unit test AjaxFormComponentUpdatingBehavior onUpdate?

I am trying to unit test a AjaxFormComponentUpdatingBehavior onUpdate
event. So far I have this:
AjaxFormComponentUpdatingBehavior updatingBehavior =
(AjaxFormComponentUpdatingBehavior)
WicketTesterHelper.findBehavior(tester.getComponentFromLastRenderedPage("test:form:upc"),
AjaxFormComponentUpdatingBehavior.class);
tester.executeBehavior(updatingBehavior);
However, this does not execute "onUpdate" which I have overridden.
Ultimately, within the behavior I am enabling a component on my page, and
I want to assert that this component is enabled after the behavior is
executed. How do I ensure that "onUpdate" is fired in my unit test?

No comments:

Post a Comment