use of org.kie.kogito.uow.events.UnitOfWorkStartEvent in project kogito-runtimes by kiegroup.
the class AbstractTransactionManagerTest method onAfterEndEvent.
@Test
void onAfterEndEvent() {
manager.onBeforeStartEvent(new UnitOfWorkStartEvent(null));
manager.onAfterEndEvent(new UnitOfWorkEndEvent(null));
verify(clientSession, times(1)).commitTransaction();
verify(clientSession, times(1)).close();
}
use of org.kie.kogito.uow.events.UnitOfWorkStartEvent in project kogito-runtimes by kiegroup.
the class AbstractTransactionManagerTest method enabled.
@Test
void enabled() {
AbstractTransactionManager manager = new AbstractTransactionManager(mongoClient, false) {
};
manager.onBeforeStartEvent(new UnitOfWorkStartEvent(null));
manager.onAfterAbortEvent(new UnitOfWorkAbortEvent(null));
verify(mongoClient, never()).startSession();
}
use of org.kie.kogito.uow.events.UnitOfWorkStartEvent in project kogito-runtimes by kiegroup.
the class AbstractTransactionManagerTest method onBeforeStartEvent.
@Test
void onBeforeStartEvent() {
manager.onBeforeStartEvent(new UnitOfWorkStartEvent(null));
verify(clientSession, times(1)).startTransaction(any());
}
use of org.kie.kogito.uow.events.UnitOfWorkStartEvent in project kogito-runtimes by kiegroup.
the class AbstractTransactionManagerTest method onAfterAbortEvent.
@Test
void onAfterAbortEvent() {
manager.onBeforeStartEvent(new UnitOfWorkStartEvent(null));
manager.onAfterAbortEvent(new UnitOfWorkAbortEvent(null));
verify(clientSession, times(1)).abortTransaction();
verify(clientSession, times(1)).close();
}
use of org.kie.kogito.uow.events.UnitOfWorkStartEvent in project kogito-runtimes by kiegroup.
the class AbstractTransactionManagerTest method getClientSession.
@Test
void getClientSession() {
assertNull(manager.getClientSession());
manager.onBeforeStartEvent(new UnitOfWorkStartEvent(null));
assertEquals(clientSession, manager.getClientSession());
}
Aggregations