@Test public void testUnitOfWorkStartAbort() { UnitOfWork unit = unitOfWorkManager.newUnitOfWork(); assertThat(unit).isNotNull().isInstanceOf(ManagedUnitOfWork.class); final AtomicInteger counter = new AtomicInteger(0); assertThat(counter.get()).isEqualTo(0); BaseWorkUnit dummyWork = new BaseWorkUnit(counter, (d) -> ((AtomicInteger) d).incrementAndGet()); unit.start(); unit.intercept(dummyWork); unit.abort(); assertThat(counter.get()).isEqualTo(0); }
@Override public UnitOfWork newUnitOfWork() { return new ManagedUnitOfWork(factory.create(eventManager), this::associate, this::dissociate, this::dissociate); }
DefaultUnitOfWorkManager implements UnitOfWorkManager { @Override public UnitOfWork newUnitOfWork() { return new ManagedUnitOfWork(factory.create(eventManager), this::associate, this::dissociate, this::dissociate); } }
DefaultUnitOfWorkManager implements UnitOfWorkManager { @Override public UnitOfWork newUnitOfWork() { return new ManagedUnitOfWork(factory.create(eventManager), this::associate, this::dissociate, this::dissociate); } DefaultUnitOfWorkManager(UnitOfWorkFactory factory);  DefaultUnitOfWorkManager(UnitOfWork fallbackUnitOfWork, UnitOfWorkFactory factory); }
DefaultUnitOfWorkManager implements UnitOfWorkManager { @Override public UnitOfWork newUnitOfWork() { return new ManagedUnitOfWork(factory.create(eventManager), this::associate, this::dissociate, this::dissociate); } DefaultUnitOfWorkManager(UnitOfWorkFactory factory);  DefaultUnitOfWorkManager(UnitOfWork fallbackUnitOfWork, UnitOfWorkFactory factory); @Override UnitOfWork currentUnitOfWork(); @Override UnitOfWork newUnitOfWork(); @Override EventManager eventManager(); }
DefaultUnitOfWorkManager implements UnitOfWorkManager { @Override public UnitOfWork newUnitOfWork() { return new ManagedUnitOfWork(factory.create(eventManager), this::associate, this::dissociate, this::dissociate); } DefaultUnitOfWorkManager(UnitOfWorkFactory factory);  DefaultUnitOfWorkManager(UnitOfWork fallbackUnitOfWork, UnitOfWorkFactory factory); @Override UnitOfWork currentUnitOfWork(); @Override UnitOfWork newUnitOfWork(); @Override EventManager eventManager();  }