Hello,
I need to create a unit test to a JavaDelegate that uses an Expression from org.camunda.bpm.engine.delegate.Expression. However, I was not able to Mock the Expression. I am using Mockito and it is an integration test.
I am able to mock the DelegateExecution:
@MockBean
private DelegateExecution execution;
Nevertheless, to Expression this is not working.
My Class is as follow:
@Service(“engineRuleDelegates”)
public class EngineRuleDelegates implements JavaDelegate {@Autowired
private EngineRulesConnector engineRulesConnector;@Autowired
private ObjectMapper mapper;@Autowired
private EngineProperties engineProperties;private Expression step;
@Override
public void execute(DelegateExecution execution) throws Exception {String stepValue = (String) step.getValue(execution);
Any ideas of how to mock the Expression would be helpful.