Я запускаю тест Junit, получаю ошибку:
GroupOptionInputPanelTest.java:
public void setUp() {
groupOptionInputPanel = new GroupOptionInputPanel(TEST_ID, new Model(new ArrayList()), null);
}
GroupOptionInputPanel.java:
public GroupOptionInputPanel(String id, IModel model, final Form parentForm) {
this(id, model, parentForm, false);
}
...
ListView options = new GroupElementListView("options", getSelectionGroup().getSelectionOptions(), getInitTabIndex()) {
..
public abstract class AbstractOptionPanel extends Panel {
public SelectionGroup getSelectionGroup() {
return (SelectionGroup) getModel().getObject();
}
ошибка:
java.lang.ClassCastException: java.util.ArrayList
at com.bgc.ordering.wizard.front.groupoptions.AbstractOptionPanel.getSelectionGroup(AbstractOptionPanel.java:33)
at com.bgc.ordering.wizard.front.groupoptions.GroupOptionInputPanel.<init>(GroupOptionInputPanel.java:54)
at com.bgc.ordering.wizard.front.groupoptions.GroupOptionInputPanel.<init>(GroupOptionInputPanel.java:47)
Как я могу решить эту ошибку?
public GroupOptionInputPanel(String id, IModel model, final Form parentForm, final boolean canDisplayExclamationMark) {
super(id, model);
this.setOutputMarkupId(true);
ListView options = new GroupElementListView("options", getSelectionGroup().getSelectionOptions(), getInitTabIndex()) {
public Model(Serializable object)
{
setObject(object);
}
Модель - API Wicket.