ContextSourceTransactionManager extends
        AbstractPlatformTransactionManager implements InitializingBean { protected Object doGetTransaction() { return delegate.doGetTransaction(); }  ContextSource getContextSource(); void setContextSource(ContextSource contextSource); void setRenamingStrategy(TempEntryRenamingStrategy renamingStrategy); void afterPropertiesSet();  }
@Test public void testDoGetTransaction() { Object result = tested.doGetTransaction(); assertThat(result).isNotNull(); assertThat(result instanceof CompensatingTransactionObject).isTrue(); CompensatingTransactionObject transactionObject = (CompensatingTransactionObject) result; assertThat(transactionObject.getHolder()).isNull(); }
@Test public void testDoGetTransactionTransactionActive() { CompensatingTransactionHolderSupport expectedContextHolder = new DirContextHolder(null, null); TransactionSynchronizationManager.bindResource(contextSourceMock, expectedContextHolder); Object result = tested.doGetTransaction(); assertThat(((CompensatingTransactionObject) result).getHolder()).isSameAs(expectedContextHolder); }