My unit test have been running ok before this migration process, but not after it. No code changes, no unit test changes done in my side. I did not notice any changes related to this in Wicket migration 7.x guide.
What could be the reason for failing unit tests?
In code I have:
private final DropDownChoice<ModificationSource> sourceChoice = createModificationSourceDropDown("source",
new PropertyModel<ModificationSource>(this, "selectedSource"));
private DropDownChoice<ModificationSource> createModificationSourceDropDown(final String id,
final IModel<ModificationSource> model) {
List<ModificationSource> sources = modificationSourceService.findAll();
DropDownChoice<ModificationSource> choice = new DropDownChoice<ModificationSource>(id, model, sources,
new ModificationSourceChoiceRenderer());
choice.setRequired(true);
choice.setNullValid(false);
return choice;
}
I am also adding DropDownChoice component to form:
form.add(sourceChoice);
In unit test I have:
FormTester formTester = tester.newFormTester("form");
formTester.select("source", 0);
In my unit test I get error that source has not been set. There are also same issues when using the application, so this is not unit test issue, but code issue.
Maybe there is something that has been changed in Wicket 6.x -> Wicket 7.x that makes this issue occur...? Maybe I should use DropDownChoice component differently now.
ps. I have DropDownChoice failures also in other places in the code. It seems that for e.g. selecting value from DropDownChoice elsewhere does not start data loading at all anymore after migration to 7.0 and my unit tests fail.