Wicket
  1. Wicket
  2. WICKET-4801

BaseWicketTester.executeAjaxEvent only fires one of multiple behaviors bound to a given event

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0
    • Fix Version/s: 6.2.0
    • Component/s: wicket
    • Labels:
      None

      Description

      Migrating from Wicket 1.4.21 to 6.0.0, I have a test failing because an AjaxFormComponentUpdatingBehavior was not executed despite calling WicketTester.executeAjaxEvent on the desired component with the correct event.

      The component in question has two behaviors added to it; both behaviors are bound to the same event. My test is only interested in exercising one of the behaviors.

      The root cause appears to be that BaseWicketTester uses WicketTesterHelper.findAjaxEventBehaviour to find and execute a behavior. That method returns only the first behavior matching the given event - even though there can be many.

      From what I can gather, Wicket 1.4.21 happens to find the behaviour I'm interested in whereas Wicket 6.0.0 happens to find the other one.

      When I exercise the same code in an actual servlet environment (Jetty), both behaviors are executed as expected.

      I've attached a quickstart project with a test case that reproduces this issue.

        Activity

        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 6.2.0 [ 12323295 ]
        Resolution Fixed [ 1 ]
        Brian Laframboise made changes -
        Field Original Value New Value
        Attachment WICKET-4801-quickstart.zip [ 12547550 ]
        Brian Laframboise created issue -

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Brian Laframboise
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development