I am working with unit testing to generate some process history and using Wiremock and HTTP connector:
Consider something like:
.... setTime(processStartTime) ProcessInstance registration = runtimeService().startProcessInstanceByKey('NewUserRegistration') forwardTime(30) complete(task(registration)) assertThat(registration).isEnded() println 'process completed' ....
Where forwardTime() moves the Clock forward using something like:
... Date forwardTime = ClockUtil.getCurrentTime() + duration.minutes ClockUtil.setCurrentTime(forwardTime) ....
When time is moved forward, the duration in mills field of History Logs for HTTP Connector are all 0 mills. If i do not move time forward, durations are as expected.
When i move time forward in the case of the User Task Completion, the duration of the user task is as expected.
Is there something lacking with Connector usage?