@Test public void isPostOnly() throws Exception { // default, no form config assertTrue(group.isPostOnly()); // default, with form config initForm(createFieldList(field1)); formConfig.setPostOnlyByDefault(false); assertFalse(group.isPostOnly()); formConfig.setPostOnlyByDefault(true); assertTrue(group.isPostOnly()); // set value group.setPostOnly(false); assertFalse(group.isPostOnly()); }
private void assertPostOnly(Boolean parentValue, Boolean overrideValue, boolean expectedValue) throws Exception { init(); if (parentValue != null) { group1.setPostOnly(parentValue); } group1.afterPropertiesSet(); if (overrideValue != null) { group2.setPostOnly(overrideValue); } group2.setParentGroup("group1"); group2.afterPropertiesSet(); formConfig.setGroupConfigImplList(createGroupList(group1, group2)); formConfig.afterPropertiesSet(); assertEquals(expectedValue, group2.isPostOnly()); }