@Test
public void testBelongsToCondition() throws Exception {

	DDMForm ddmForm = new DDMForm();
	DDMFormField ddmFormField0 = createDDMFormField(
		"field0", "text", FieldConstants.STRING);
	ddmForm.addDDMFormField(ddmFormField0);
	ddmForm.addDDMFormRule(
		new DDMFormRule(
			Arrays.asList("setEnabled(\"field0\", false)"),
			"belongsTo([\"Role1\"])"));
	DDMFormValues ddmFormValues = DDMFormValuesTestUtil.createDDMFormValues(
		ddmForm);
	ddmFormValues.addDDMFormFieldValue(
		DDMFormValuesTestUtil.createDDMFormFieldValue(
			"field0_instanceId", "field0", new UnlocalizedValue("")));
	Mockito.when(
		_roleLocalService.fetchRole(
			Matchers.anyLong(), Matchers.anyString())
	).thenReturn(
		_role
	);
	Mockito.when(
		_role.getType()
	).thenReturn(
		RoleConstants.TYPE_REGULAR
	);
	Mockito.when(
		_userLocalService.hasRoleUser(
			Matchers.anyLong(), Matchers.eq("Role1"), Matchers.anyLong(),
			Matchers.eq(true))
	).thenReturn(
		true
	);
	DDMFormEvaluatorEvaluateResponse ddmFormEvaluatorEvaluateResponse =
		doEvaluate(ddmForm, ddmFormValues);
	Map<DDMFormEvaluatorFieldContextKey, Map<String, Object>>
		ddmFormFieldsPropertyChanges =
			ddmFormEvaluatorEvaluateResponse.
				getDDMFormFieldsPropertyChanges();
	Assert.assertEquals(
		ddmFormFieldsPropertyChanges.toString(), 1,
		ddmFormFieldsPropertyChanges.size());
	Map<String, Object> ddmFormFieldPropertyChanges =
		ddmFormFieldsPropertyChanges.get(
			new DDMFormEvaluatorFieldContextKey(
				"field0", "field0_instanceId"));
	Assert.assertTrue((boolean)ddmFormFieldPropertyChanges.get("readOnly"));
}