ActivitiHelper { public String getRequiredExpressionVariableAsString(Expression expression, DelegateExecution execution, String variableName) throws IllegalArgumentException { String variableString = getExpressionVariableAsString(expression, execution); if (StringUtils.isBlank(variableString)) { throw new IllegalArgumentException("\"" + variableName + "\" must be specified."); } return variableString; }  String getProcessIdentifyingInformation(DelegateExecution execution); Object getExpressionVariable(Expression expression, DelegateExecution execution); String getExpressionVariableAsString(Expression expression, DelegateExecution execution); String getRequiredExpressionVariableAsString(Expression expression, DelegateExecution execution, String variableName); Integer getExpressionVariableAsInteger(Expression expression, DelegateExecution execution, String variableName, boolean isRequired); Boolean getExpressionVariableAsBoolean(Expression expression, DelegateExecution execution, String variableName, boolean isRequired,
        Boolean defaultValue); BpmnModel constructBpmnModelFromXmlAndValidate(String xmlString);  }
@Test public void testGetRequiredExpressionVariableAsString() { Expression expression = mock(Expression.class); DelegateExecution execution = mock(DelegateExecution.class); when(expression.getValue(execution)).thenReturn(STRING_VALUE); String result = activitiHelper.getRequiredExpressionVariableAsString(expression, execution, VARIABLE_NAME); assertEquals(STRING_VALUE, result); }
@Test public void testGetRequiredExpressionVariableAsStringBlankValue() { Expression expression = mock(Expression.class); DelegateExecution execution = mock(DelegateExecution.class); when(expression.getValue(execution)).thenReturn(BLANK_TEXT); try { activitiHelper.getRequiredExpressionVariableAsString(expression, execution, VARIABLE_NAME); fail(); } catch (IllegalArgumentException e) { assertEquals(String.format("\"%s\" must be specified.", VARIABLE_NAME), e.getMessage()); } }