use of org.kie.kogito.mongodb.transaction.MongoDBTransactionManager 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.mongodb.transaction.MongoDBTransactionManager in project kogito-runtimes by kiegroup.
the class MongoDBProcessInstancesIT method testValuesReadMode.
@Test
void testValuesReadMode() {
MongoDBTransactionManager transactionManager = new MongoDBTransactionManager(mongoClient) {
@Override
public boolean enabled() {
return false;
}
};
testValuesReadMode(transactionManager);
}
use of org.kie.kogito.mongodb.transaction.MongoDBTransactionManager in project kogito-runtimes by kiegroup.
the class MongoDBProcessInstancesIT method testValuesReadModeWithTransaction.
@Test
void testValuesReadModeWithTransaction() {
MongoDBTransactionManager transactionManager = new MongoDBTransactionManager(mongoClient) {
@Override
public boolean enabled() {
return true;
}
};
transactionManager.onBeforeStartEvent(new UnitOfWorkStartEvent(null));
testValuesReadMode(transactionManager);
transactionManager.onAfterEndEvent(new UnitOfWorkEndEvent(null));
}
use of org.kie.kogito.mongodb.transaction.MongoDBTransactionManager in project kogito-runtimes by kiegroup.
the class MongoDBProcessInstancesIT method testFindByIdReadModeWithTransaction.
@Test
void testFindByIdReadModeWithTransaction() {
MongoDBTransactionManager transactionManager = new MongoDBTransactionManager(mongoClient) {
@Override
public boolean enabled() {
return true;
}
};
transactionManager.onBeforeStartEvent(new UnitOfWorkStartEvent(null));
testFindByIdReadMode(transactionManager);
transactionManager.onAfterEndEvent(new UnitOfWorkEndEvent(null));
}
use of org.kie.kogito.mongodb.transaction.MongoDBTransactionManager in project kogito-runtimes by kiegroup.
the class MongoDBProcessInstancesIT method testFindByIdReadMode.
@Test
void testFindByIdReadMode() {
MongoDBTransactionManager transactionManager = new MongoDBTransactionManager(mongoClient) {
@Override
public boolean enabled() {
return false;
}
};
testFindByIdReadMode(transactionManager);
}
Aggregations