use of org.camunda.spin.xml.SpinXmlElement in project camunda-bpm-platform by camunda.
the class XmlValueTest method testGetUntypedXmlValue.
@Deployment(resources = ONE_TASK_PROCESS)
public void testGetUntypedXmlValue() {
// given
XmlValue xmlValue = xmlValue(xmlString).create();
VariableMap variables = Variables.createVariables().putValueTyped(variableName, xmlValue);
String processInstanceId = runtimeService.startProcessInstanceByKey(ONE_TASK_PROCESS_KEY, variables).getId();
// when
SpinXmlElement value = (SpinXmlElement) runtimeService.getVariable(processInstanceId, variableName);
// then
assertTrue(value.hasAttr("attrName"));
assertEquals("attrValue", value.attr("attrName").value());
assertTrue(value.childElements().isEmpty());
assertEquals(xml().getName(), value.getDataFormatName());
}
Aggregations