use of org.kie.kogito.persistence.KogitoProcessInstancesFactory in project kogito-runtimes by kiegroup.
the class KogitoProcessInstancesFactoryIT method test.
@Test
void test() {
MongoDBTransactionManager transactionManager = mock(MongoDBTransactionManager.class);
KogitoProcessInstancesFactory factory = new KogitoProcessInstancesFactory(getMongoClient()) {
@Override
public String dbName() {
return DB_NAME;
}
@Override
public MongoDBTransactionManager transactionManager() {
return transactionManager;
}
@Override
public boolean lock() {
return false;
}
};
assertNotNull(factory);
assertThat(factory.dbName()).isEqualTo(DB_NAME);
Process<?> process = mock(Process.class);
lenient().when(process.id()).thenReturn(PROCESS_NAME);
lenient().when(process.name()).thenReturn(PROCESS_NAME);
MongoDBProcessInstances<?> instance = factory.createProcessInstances(process);
assertNotNull(instance);
assertEquals(transactionManager, factory.transactionManager());
}
use of org.kie.kogito.persistence.KogitoProcessInstancesFactory in project kogito-runtimes by kiegroup.
the class KogitoProcessInstancesFactoryTest method testCreate.
@Test
void testCreate() {
RemoteCacheManager cacheManager = mock(RemoteCacheManager.class);
when(cacheManager.administration()).thenReturn(mock(RemoteCacheManagerAdmin.class));
KogitoProcessInstancesFactory factory = new KogitoProcessInstancesFactory(cacheManager) {
@Override
public boolean lock() {
return false;
}
};
assertNotNull(factory.createProcessInstances(mock(Process.class)));
}
use of org.kie.kogito.persistence.KogitoProcessInstancesFactory in project kogito-runtimes by kiegroup.
the class CacheProcessInstancesWithLockIT method createProcess.
private BpmnProcess createProcess(String fileName) {
BpmnProcess process = BpmnProcess.from(new ClassPathResource(fileName)).get(0);
KogitoProcessInstancesFactory factory = mock(KogitoProcessInstancesFactory.class);
process.setProcessInstancesFactory(factory);
process.configure();
return process;
}
Aggregations