ServiceLoader<ProcessEngineProvider> serviceLoader = ServiceLoader
.load(ProcessEngineProvider.class);
Iterator<ProcessEngineProvider> iterator = serviceLoader.iterator();
if (iterator.hasNext()) {
MockedProcessEngineProvider provider = (MockedProcessEngineProvider) iterator.next();
// reset engine mocks before every test
provider.resetEngines();
processEngine = provider.getDefaultProcessEngine();
}
}