diff --git a/source/org/jivesoftware/smackx/pubsub/ConfigureForm.java b/source/org/jivesoftware/smackx/pubsub/ConfigureForm.java index 2962c9bee..7f1005e87 100644 --- a/source/org/jivesoftware/smackx/pubsub/ConfigureForm.java +++ b/source/org/jivesoftware/smackx/pubsub/ConfigureForm.java @@ -161,7 +161,9 @@ public class ConfigureForm extends Form public void setChildrenAssociationPolicy(ChildrenAssociationPolicy policy) { addField(ConfigureNodeFields.children_association_policy, FormField.TYPE_LIST_SINGLE); - setAnswer(ConfigureNodeFields.children_association_policy.getFieldName(), policy.toString()); + List values = new ArrayList(1); + values.add(policy.toString()); + setAnswer(ConfigureNodeFields.children_association_policy.getFieldName(), values); } /** diff --git a/test-unit/org/jivesoftware/smackx/pubsub/ConfigureFormTest.java b/test-unit/org/jivesoftware/smackx/pubsub/ConfigureFormTest.java new file mode 100644 index 000000000..291d16019 --- /dev/null +++ b/test-unit/org/jivesoftware/smackx/pubsub/ConfigureFormTest.java @@ -0,0 +1,16 @@ +package org.jivesoftware.smackx.pubsub; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class ConfigureFormTest +{ + @Test + public void checkChildrenAssocPolicy() + { + ConfigureForm form = new ConfigureForm(FormType.submit); + form.setChildrenAssociationPolicy(ChildrenAssociationPolicy.owners); + assertEquals(ChildrenAssociationPolicy.owners, form.getChildrenAssociationPolicy()); + } +}