@Test
public void testSerialize() {

	when(
		_calculateDDMFormRuleAction.getExpression()
	).thenReturn(
		"(text + text1) * 2"
	);
	when(
		_calculateDDMFormRuleAction.getTarget()
	).thenReturn(
		"text2"
	);
	DDMForm ddmForm = new DDMForm();
	DDMFormField ddmFormField1 = new DDMFormField("text", "string");
	DDMFormField ddmFormField2 = new DDMFormField("text1", "string");
	ddmForm.setDDMFormFields(Arrays.asList(ddmFormField1, ddmFormField2));
	when(
		_serviceContext.getAttribute("form")
	).thenReturn(
		ddmForm
	);
	CalculateDDMFormRuleActionSerializer
		calculateDDMFormRuleActionSerializer =
			new CalculateDDMFormRuleActionSerializer(
				_calculateDDMFormRuleAction);
	PowerMockito.when(
		_spiDDMFormRuleSerializerContext.getAttribute("form")
	).thenReturn(
		ddmForm
	);
	String result = calculateDDMFormRuleActionSerializer.serialize(
		_spiDDMFormRuleSerializerContext);
	Assert.assertEquals(
		"calculate('text2', (getValue('text') + getValue('text1')) * 2)",
		result);
}