both wicketTester.executeAjaxEvent(..) aswell as wicketTester.newFormTester(..).submit(..)
cannot handle cases where multiple click behaviors are attached to the submitting component, i.e. a button, and the first behavior processed within BaseWicketTester.executeAjaxEvent(final Component component, final String event) is the non-submitting (i.e. not AjaxFormSubmitBehavior) behavior.
This first behavoir creates a brand new request after being processed, and thus clears the uploadedFile added beforehand via tester.getRequest().addFile(..) needed when submission of the form is processed.
In my case there is such a behavior (a loading indicator) that I had, as a workaround to this bug, first to remove in my test code in order to make my unit test work: