Search in sources :

Example 1 with ProcessService

use of org.kie.kogito.process.ProcessService in project kogito-runtimes by kiegroup.

the class EventImplTest method setup.

@BeforeEach
void setup() {
    application = mock(Application.class);
    when(application.unitOfWorkManager()).thenReturn(new DefaultUnitOfWorkManager(new CollectingUnitOfWorkFactory()));
    process = mock(Process.class);
    processInstances = mock(ProcessInstances.class);
    processInstance = mock(ProcessInstance.class);
    when(process.instances()).thenReturn(processInstances);
    when(processInstances.findById(Mockito.anyString())).thenReturn(Optional.of(processInstance));
    when(process.createInstance(Mockito.any(DummyModel.class))).thenReturn(processInstance);
    processService = mock(ProcessService.class);
    executor = Executors.newSingleThreadExecutor();
}
Also used : ProcessInstances(org.kie.kogito.process.ProcessInstances) CollectingUnitOfWorkFactory(org.kie.kogito.services.uow.CollectingUnitOfWorkFactory) Process(org.kie.kogito.process.Process) ProcessInstance(org.kie.kogito.process.ProcessInstance) ProcessService(org.kie.kogito.process.ProcessService) Application(org.kie.kogito.Application) DefaultUnitOfWorkManager(org.kie.kogito.services.uow.DefaultUnitOfWorkManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BeforeEach (org.junit.jupiter.api.BeforeEach)1 Application (org.kie.kogito.Application)1 Process (org.kie.kogito.process.Process)1 ProcessInstance (org.kie.kogito.process.ProcessInstance)1 ProcessInstances (org.kie.kogito.process.ProcessInstances)1 ProcessService (org.kie.kogito.process.ProcessService)1 CollectingUnitOfWorkFactory (org.kie.kogito.services.uow.CollectingUnitOfWorkFactory)1 DefaultUnitOfWorkManager (org.kie.kogito.services.uow.DefaultUnitOfWorkManager)1