use of org.camunda.spin.plugin.variable.value.builder.XmlValueBuilder in project camunda-bpm-platform by camunda.
the class XmlValueTest method testFailForNonExistingSerializationFormat.
@Deployment(resources = ONE_TASK_PROCESS)
public void testFailForNonExistingSerializationFormat() {
// given
XmlValueBuilder builder = xmlValue(xmlString).serializationDataFormat("non existing data format");
String processInstanceId = runtimeService.startProcessInstanceByKey(ONE_TASK_PROCESS_KEY).getId();
try {
// when (1)
runtimeService.setVariable(processInstanceId, variableName, builder);
fail("Exception expected");
} catch (ProcessEngineException e) {
// then (1)
assertTextPresent("Cannot find serializer for value", e.getMessage());
// happy path
}
try {
// when (2)
runtimeService.setVariable(processInstanceId, variableName, builder.create());
fail("Exception expected");
} catch (ProcessEngineException e) {
// then (2)
assertTextPresent("Cannot find serializer for value", e.getMessage());
// happy path
}
}
Aggregations