You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Kamil (JIRA)" <ji...@apache.org> on 2017/10/27 13:51:00 UTC

[jira] [Created] (WICKET-6487) Please provide WicketTester#executeBehavior(Class) method

Kamil created WICKET-6487:
-----------------------------

             Summary: Please provide WicketTester#executeBehavior(Class<? extends AbstractAjaxBehavior>) method
                 Key: WICKET-6487
                 URL: https://issues.apache.org/jira/browse/WICKET-6487
             Project: Wicket
          Issue Type: Improvement
            Reporter: Kamil
            Priority: Minor


WicketTester has executeBehavior(AbstractAjaxBehavior) method, but most often one have Behaviors added inside tested component, which operates on component's internals/private fields. For example:
{code}
AbstractDefaultAjaxBehavior myBehavior = new AbstractDefaultAjaxBehavior() {
	@Override
	protected void respond(AjaxRequestTarget target) {
		target.add(buttonsContainer); //private field
	}
};
add(myBehavior);
{code}

If I want to execute this particular behavior I need to do:
{code}
MyPanel panel = wicketTester.startComponentInPage(new MyPanel());   panel.getBehaviors(AbstractDefaultAjaxBehavior.class).forEach(wicketTester::executeBehavior);
{code}

It would be great to have:
executeBehavior(Class<? extends AbstractAjaxBehavior>) that does exactly that



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)