@Test
public void testDisablePages() throws Exception {

	// Dynamic data mapping form
	DDMForm ddmForm = DDMFormTestUtil.createDDMForm();
	ddmForm.addDDMFormRule(
		new DDMFormRule(Arrays.asList("jumpPage(0, 2)"), "TRUE"));
	ddmForm.addDDMFormField(
		DDMFormTestUtil.createDDMFormField(
			"Field1", "Field1", "text", "string", false, false, true));
	ddmForm.addDDMFormField(
		DDMFormTestUtil.createDDMFormField(
			"Field2", "Field2", "text", "string", false, false, false));
	ddmForm.addDDMFormField(
		DDMFormTestUtil.createDDMFormField(
			"Field3", "Field3", "text", "string", false, false, false));
	// Dynamic data mapping form layout
	DDMFormLayout ddmFormLayout = new DDMFormLayout();
	ddmFormLayout = createDDMFormLayoutPage(
		ddmFormLayout, "Page 1", "Page 1 Description", "Field1");
	ddmFormLayout = createDDMFormLayoutPage(
		ddmFormLayout, "Page 2", "Page 2 Description", "Field2");
	ddmFormLayout = createDDMFormLayoutPage(
		ddmFormLayout, "Page 3", "Page 3 Description", "Field3");
	// Dynamic data mapping form values
	DDMFormValues ddmFormValues = DDMFormValuesTestUtil.createDDMFormValues(
		ddmForm);
	ddmFormValues.addDDMFormFieldValue(
		DDMFormValuesTestUtil.createUnlocalizedDDMFormFieldValue(
			"Field1", "A"));
	ddmFormValues.addDDMFormFieldValue(
		DDMFormValuesTestUtil.createUnlocalizedDDMFormFieldValue(
			"Field2", ""));
	ddmFormValues.addDDMFormFieldValue(
		DDMFormValuesTestUtil.createUnlocalizedDDMFormFieldValue(
			"Field3", ""));
	// Template context
	DDMFormPagesTemplateContextFactory ddmFormPagesTemplateContextFactory =
		createDDMFormPagesTemplateContextFactory(
			ddmForm, ddmFormLayout, ddmFormValues, false, false, false);
	mockDDMFormFieldTypeServicesTracker(
		"text",
		_ddmFormFieldTemplateContextContributorTestHelper.
			createTextDDMFormFieldTemplateContextContributor());
	List<Object> pagesTemplateContext =
		ddmFormPagesTemplateContextFactory.create();
	Assert.assertEquals(
		pagesTemplateContext.toString(), 3, pagesTemplateContext.size());
	Map<String, Object> page1TemplateContext =
		(Map<String, Object>)pagesTemplateContext.get(0);
	Assert.assertTrue(MapUtil.getBoolean(page1TemplateContext, "enabled"));
	Map<String, Object> page2TemplateContext =
		(Map<String, Object>)pagesTemplateContext.get(1);
	Assert.assertFalse(MapUtil.getBoolean(page2TemplateContext, "enabled"));
	Map<String, Object> page3TemplateContext =
		(Map<String, Object>)pagesTemplateContext.get(2);
	Assert.assertTrue(MapUtil.getBoolean(page3TemplateContext, "enabled"));
}