public ProcessInstanceIdContext answer(InvocationOnMock invocation) throws Throwable {
++times;
if( times > 1 ) {
throw new IllegalStateException("A process instance id is expected to be passed, received and used in the second call.");
}
return new ProcessInstanceIdContext(null);
}
});
break;
case PER_REQUEST:
runtimeMgrMock = mock(PerRequestRuntimeManager.class);