this.revision = revision;
return this;
}
public HistoricVariableUpdate build() {
HistoricVariableUpdate mockVariable = mock(HistoricVariableUpdate.class);
when(mockVariable.getId()).thenReturn(id);
when(mockVariable.getVariableName()).thenReturn(name);
when(mockVariable.getVariableTypeName()).thenReturn(typedValue.getType().getName());
if (ObjectValue.class.isAssignableFrom(typedValue.getClass())) {
ObjectValue objectValue = (ObjectValue) typedValue;
if (objectValue.isDeserialized()) {
when(mockVariable.getValue()).thenReturn(typedValue.getValue());
} else {
when(mockVariable.getValue()).thenReturn(null);
}
} else {
when(mockVariable.getValue()).thenReturn(typedValue.getValue());
}
when(mockVariable.getTypedValue()).thenReturn(typedValue);
when(mockVariable.getProcessInstanceId()).thenReturn(processInstanceId);
when(mockVariable.getErrorMessage()).thenReturn(errorMessage);
when(mockVariable.getRevision()).thenReturn(revision);
when(mockVariable.getTime()).thenReturn(DateTimeUtil.parseDate(time));
when(mockVariable.getActivityInstanceId()).thenReturn(activityInstanceId);
when(mockVariable.getTaskId()).thenReturn(taskId);
when(mockVariable.getExecutionId()).thenReturn(executionId);
when(mockVariable.getTypeName()).thenReturn(typedValue.getType().getName());
return mockVariable;
}