public String getActivityInstanceId() {
return activityInstanceId;
}
public HistoricVariableInstance build() {
HistoricVariableInstance mockVariable = mock(HistoricVariableInstance.class);
when(mockVariable.getId()).thenReturn(id);
when(mockVariable.getName()).thenReturn(name);
when(mockVariable.getVariableName()).thenReturn(name);
when(mockVariable.getTypeName()).thenReturn(value.getType().getName());
when(mockVariable.getVariableTypeName()).thenReturn(value.getType().getName());
if (ObjectValue.class.isAssignableFrom(value.getClass())) {
ObjectValue objectValue = (ObjectValue) value;
if (objectValue.isDeserialized()) {
when(mockVariable.getValue()).thenReturn(value.getValue());
} else {
when(mockVariable.getValue()).thenReturn(null);
}
} else {
when(mockVariable.getValue()).thenReturn(value.getValue());
}
when(mockVariable.getTypedValue()).thenReturn(value);
when(mockVariable.getProcessInstanceId()).thenReturn(processInstanceId);
when(mockVariable.getErrorMessage()).thenReturn(errorMessage);
when(mockVariable.getActivtyInstanceId()).thenReturn(activityInstanceId);
when(mockVariable.getActivityInstanceId()).thenReturn(activityInstanceId);
return mockVariable;
}