@Test void testNotCurrentUnitOfWorkCommitted() { DefaultUnitOfWork<?> outerUoW = new DefaultUnitOfWork<>(null); outerUoW.start(); new DefaultUnitOfWork<>(null).start(); try { outerUoW.commit(); } catch (IllegalStateException e) { return; } throw new AssertionError("The unit of work is not the current"); }
public static void commit() { get().commit(); }
CurrentUnitOfWork { public static void commit() { get().commit(); } }
CurrentUnitOfWork { public static void commit() { get().commit(); } private  CurrentUnitOfWork(); }
CurrentUnitOfWork { public static void commit() { get().commit(); } private  CurrentUnitOfWork(); static boolean isStarted(); static boolean ifStarted(Consumer<UnitOfWork<?>> consumer); static Optional<T> map(Function<UnitOfWork<?>, T> function); static UnitOfWork<?> get(); static void commit(); static void set(UnitOfWork<?> unitOfWork); static void clear(UnitOfWork<?> unitOfWork); static MetaData correlationData(); }
CurrentUnitOfWork { public static void commit() { get().commit(); } private  CurrentUnitOfWork(); static boolean isStarted(); static boolean ifStarted(Consumer<UnitOfWork<?>> consumer); static Optional<T> map(Function<UnitOfWork<?>, T> function); static UnitOfWork<?> get(); static void commit(); static void set(UnitOfWork<?> unitOfWork); static void clear(UnitOfWork<?> unitOfWork); static MetaData correlationData();  }