throw new IllegalArgumentException("'" + formComponentId + "' is not "
+ "a FileUploadField. You can only attach a file to form "
+ "component of this type.");
}
SwarmMockHttpServletRequest servletRequest = baseWicketTester.getServletRequest();
servletRequest.addFile(formComponent.getInputName(), file, contentType);
}