use of org.camunda.bpm.engine.variable.value.builder.SerializedObjectValueBuilder in project camunda-bpm-platform by camunda.
the class JsonSerializationTest method testSetSerializedVariableValueNoTypeName.
@Deployment(resources = ONE_TASK_PROCESS)
public void testSetSerializedVariableValueNoTypeName() throws JSONException {
ProcessInstance instance = runtimeService.startProcessInstanceByKey("oneTaskProcess");
JsonSerializable bean = new JsonSerializable("a String", 42, true);
String beanAsJson = bean.toExpectedJsonString();
SerializedObjectValueBuilder serializedValue = serializedObjectValue(beanAsJson).serializationDataFormat(JSON_FORMAT_NAME);
try {
runtimeService.setVariable(instance.getId(), "simpleBean", serializedValue);
fail("Exception expected.");
} catch (Exception e) {
assertTextPresent("no 'objectTypeName' provided for non-null value", e.getMessage());
}
}
Aggregations