mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Remove test prefixes and avoid warnings in JDBC and TX tests
This commit is contained in:
+36
-28
@@ -90,15 +90,16 @@ class DataSourceJtaTransactionTests {
|
||||
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommit() throws Exception {
|
||||
void jtaTransactionCommit() throws Exception {
|
||||
doTestJtaTransaction(false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionRollback() throws Exception {
|
||||
void jtaTransactionRollback() throws Exception {
|
||||
doTestJtaTransaction(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void doTestJtaTransaction(final boolean rollback) throws Exception {
|
||||
if (rollback) {
|
||||
given(userTransaction.getStatus()).willReturn(
|
||||
@@ -145,55 +146,56 @@ class DataSourceJtaTransactionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNew() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNew() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(false, false, false, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithAccessAfterResume() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithAccessAfterResume() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(false, false, true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnection() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnection() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(false, true, false, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAccessed() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAccessed() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(false, true, true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithTransactionAwareDataSource() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithTransactionAwareDataSource() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(false, false, true, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionRollbackWithPropagationRequiresNew() throws Exception {
|
||||
void jtaTransactionRollbackWithPropagationRequiresNew() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(true, false, false, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionRollbackWithPropagationRequiresNewWithAccessAfterResume() throws Exception {
|
||||
void jtaTransactionRollbackWithPropagationRequiresNewWithAccessAfterResume() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(true, false, true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionRollbackWithPropagationRequiresNewWithOpenOuterConnection() throws Exception {
|
||||
void jtaTransactionRollbackWithPropagationRequiresNewWithOpenOuterConnection() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(true, true, false, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionRollbackWithPropagationRequiresNewWithOpenOuterConnectionAccessed() throws Exception {
|
||||
void jtaTransactionRollbackWithPropagationRequiresNewWithOpenOuterConnectionAccessed() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(true, true, true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionRollbackWithPropagationRequiresNewWithTransactionAwareDataSource() throws Exception {
|
||||
void jtaTransactionRollbackWithPropagationRequiresNewWithTransactionAwareDataSource() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNew(true, false, true, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void doTestJtaTransactionWithPropagationRequiresNew(
|
||||
final boolean rollback, final boolean openOuterConnection, final boolean accessAfterResume,
|
||||
final boolean useTransactionAwareDataSource) throws Exception {
|
||||
@@ -316,25 +318,26 @@ class DataSourceJtaTransactionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiredWithinSupports() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiredWithinSupports() throws Exception {
|
||||
doTestJtaTransactionCommitWithNewTransactionWithinEmptyTransaction(false, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiredWithinNotSupported() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiredWithinNotSupported() throws Exception {
|
||||
doTestJtaTransactionCommitWithNewTransactionWithinEmptyTransaction(false, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithinSupports() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithinSupports() throws Exception {
|
||||
doTestJtaTransactionCommitWithNewTransactionWithinEmptyTransaction(true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithinNotSupported() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithinNotSupported() throws Exception {
|
||||
doTestJtaTransactionCommitWithNewTransactionWithinEmptyTransaction(true, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void doTestJtaTransactionCommitWithNewTransactionWithinEmptyTransaction(
|
||||
final boolean requiresNew, boolean notSupported) throws Exception {
|
||||
|
||||
@@ -405,45 +408,46 @@ class DataSourceJtaTransactionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewAndSuspendException() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewAndSuspendException() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNewAndBeginException(true, false, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAndSuspendException() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAndSuspendException() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNewAndBeginException(true, true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithTransactionAwareDataSourceAndSuspendException() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithTransactionAwareDataSourceAndSuspendException() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNewAndBeginException(true, false, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAndTransactionAwareDataSourceAndSuspendException() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAndTransactionAwareDataSourceAndSuspendException() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNewAndBeginException(true, true, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewAndBeginException() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewAndBeginException() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNewAndBeginException(false, false, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAndBeginException() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAndBeginException() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNewAndBeginException(false, true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAndTransactionAwareDataSourceAndBeginException() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithOpenOuterConnectionAndTransactionAwareDataSourceAndBeginException() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNewAndBeginException(false, true, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionCommitWithPropagationRequiresNewWithTransactionAwareDataSourceAndBeginException() throws Exception {
|
||||
void jtaTransactionCommitWithPropagationRequiresNewWithTransactionAwareDataSourceAndBeginException() throws Exception {
|
||||
doTestJtaTransactionWithPropagationRequiresNewAndBeginException(false, false, true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void doTestJtaTransactionWithPropagationRequiresNewAndBeginException(boolean suspendException,
|
||||
final boolean openOuterConnection, final boolean useTransactionAwareDataSource) throws Exception {
|
||||
|
||||
@@ -544,8 +548,9 @@ class DataSourceJtaTransactionTests {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
void testJtaTransactionWithConnectionHolderStillBound() throws Exception {
|
||||
void jtaTransactionWithConnectionHolderStillBound() throws Exception {
|
||||
@SuppressWarnings("serial")
|
||||
JtaTransactionManager ptm = new JtaTransactionManager(userTransaction) {
|
||||
|
||||
@@ -601,8 +606,9 @@ class DataSourceJtaTransactionTests {
|
||||
verify(connection, times(3)).close();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
void testJtaTransactionWithIsolationLevelDataSourceAdapter() throws Exception {
|
||||
void jtaTransactionWithIsolationLevelDataSourceAdapter() throws Exception {
|
||||
given(userTransaction.getStatus()).willReturn(
|
||||
Status.STATUS_NO_TRANSACTION,
|
||||
Status.STATUS_ACTIVE,
|
||||
@@ -649,15 +655,16 @@ class DataSourceJtaTransactionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionWithIsolationLevelDataSourceRouter() throws Exception {
|
||||
void jtaTransactionWithIsolationLevelDataSourceRouter() throws Exception {
|
||||
doTestJtaTransactionWithIsolationLevelDataSourceRouter(false);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testJtaTransactionWithIsolationLevelDataSourceRouterWithDataSourceLookup() throws Exception {
|
||||
void jtaTransactionWithIsolationLevelDataSourceRouterWithDataSourceLookup() throws Exception {
|
||||
doTestJtaTransactionWithIsolationLevelDataSourceRouter(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void doTestJtaTransactionWithIsolationLevelDataSourceRouter(boolean dataSourceLookup) throws Exception {
|
||||
given(userTransaction.getStatus())
|
||||
.willReturn(Status.STATUS_NO_TRANSACTION, Status.STATUS_ACTIVE, Status.STATUS_ACTIVE, Status.STATUS_NO_TRANSACTION, Status.STATUS_ACTIVE, Status.STATUS_ACTIVE);
|
||||
@@ -717,4 +724,5 @@ class DataSourceJtaTransactionTests {
|
||||
verify(connection1).close();
|
||||
verify(connection2).close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+558
-737
File diff suppressed because it is too large
Load Diff
+57
-82
@@ -25,9 +25,7 @@ import org.mockito.InOrder;
|
||||
|
||||
import org.springframework.dao.ConcurrencyFailureException;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManagerTests;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
import org.springframework.transaction.TransactionSystemException;
|
||||
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
@@ -53,36 +51,14 @@ class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests {
|
||||
|
||||
@Override
|
||||
@Test
|
||||
protected void testTransactionWithExceptionOnCommit() throws Exception {
|
||||
protected void transactionWithExceptionOnCommit() throws Exception {
|
||||
willThrow(new SQLException("Cannot commit")).given(con).commit();
|
||||
TransactionTemplate tt = new TransactionTemplate(tm);
|
||||
|
||||
// plain TransactionSystemException
|
||||
assertThatExceptionOfType(TransactionSystemException.class).isThrownBy(() ->
|
||||
tt.execute(new TransactionCallbackWithoutResult() {
|
||||
@Override
|
||||
protected void doInTransactionWithoutResult(TransactionStatus status) {
|
||||
tt.executeWithoutResult(status -> {
|
||||
// something transactional
|
||||
}
|
||||
}));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
verify(con).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTransactionWithDataAccessExceptionOnCommit() throws Exception {
|
||||
willThrow(new SQLException("Cannot commit")).given(con).commit();
|
||||
((JdbcTransactionManager) tm).setExceptionTranslator((task, sql, ex) -> new ConcurrencyFailureException(task));
|
||||
TransactionTemplate tt = new TransactionTemplate(tm);
|
||||
|
||||
// specific ConcurrencyFailureException
|
||||
assertThatExceptionOfType(ConcurrencyFailureException.class).isThrownBy(() ->
|
||||
tt.execute(new TransactionCallbackWithoutResult() {
|
||||
@Override
|
||||
protected void doInTransactionWithoutResult(TransactionStatus status) {
|
||||
// something transactional
|
||||
}
|
||||
}));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
@@ -90,17 +66,30 @@ class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTransactionWithDataAccessExceptionOnCommitFromLazyExceptionTranslator() throws Exception {
|
||||
void transactionWithDataAccessExceptionOnCommit() throws Exception {
|
||||
willThrow(new SQLException("Cannot commit")).given(con).commit();
|
||||
((JdbcTransactionManager) tm).setExceptionTranslator((task, sql, ex) -> new ConcurrencyFailureException(task));
|
||||
TransactionTemplate tt = new TransactionTemplate(tm);
|
||||
|
||||
// specific ConcurrencyFailureException
|
||||
assertThatExceptionOfType(ConcurrencyFailureException.class).isThrownBy(() ->
|
||||
tt.executeWithoutResult(status -> {
|
||||
// something transactional
|
||||
}));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
verify(con).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void transactionWithDataAccessExceptionOnCommitFromLazyExceptionTranslator() throws Exception {
|
||||
willThrow(new SQLException("Cannot commit", "40")).given(con).commit();
|
||||
TransactionTemplate tt = new TransactionTemplate(tm);
|
||||
|
||||
// specific ConcurrencyFailureException
|
||||
assertThatExceptionOfType(ConcurrencyFailureException.class).isThrownBy(() ->
|
||||
tt.execute(new TransactionCallbackWithoutResult() {
|
||||
@Override
|
||||
protected void doInTransactionWithoutResult(TransactionStatus status) {
|
||||
// something transactional
|
||||
}
|
||||
tt.executeWithoutResult(status -> {
|
||||
// something transactional
|
||||
}));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
@@ -109,7 +98,7 @@ class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests {
|
||||
|
||||
@Override
|
||||
@Test
|
||||
protected void testTransactionWithExceptionOnCommitAndRollbackOnCommitFailure() throws Exception {
|
||||
protected void transactionWithExceptionOnCommitAndRollbackOnCommitFailure() throws Exception {
|
||||
willThrow(new SQLException("Cannot commit")).given(con).commit();
|
||||
|
||||
tm.setRollbackOnCommitFailure(true);
|
||||
@@ -117,12 +106,9 @@ class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests {
|
||||
|
||||
// plain TransactionSystemException
|
||||
assertThatExceptionOfType(TransactionSystemException.class).isThrownBy(() ->
|
||||
tt.execute(new TransactionCallbackWithoutResult() {
|
||||
@Override
|
||||
protected void doInTransactionWithoutResult(TransactionStatus status) {
|
||||
tt.executeWithoutResult(status -> {
|
||||
// something transactional
|
||||
}
|
||||
}));
|
||||
}));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
verify(con).rollback();
|
||||
@@ -131,16 +117,14 @@ class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests {
|
||||
|
||||
@Override
|
||||
@Test
|
||||
protected void testTransactionWithExceptionOnRollback() throws Exception {
|
||||
protected void transactionWithExceptionOnRollback() throws Exception {
|
||||
given(con.getAutoCommit()).willReturn(true);
|
||||
willThrow(new SQLException("Cannot rollback")).given(con).rollback();
|
||||
TransactionTemplate tt = new TransactionTemplate(tm);
|
||||
|
||||
// plain TransactionSystemException
|
||||
assertThatExceptionOfType(TransactionSystemException.class).isThrownBy(() ->
|
||||
tt.execute(new TransactionCallbackWithoutResult() {
|
||||
@Override
|
||||
protected void doInTransactionWithoutResult(TransactionStatus status) throws RuntimeException {
|
||||
tt.executeWithoutResult(status -> {
|
||||
assertThat(status.getTransactionName()).isEmpty();
|
||||
assertThat(status.hasTransaction()).isTrue();
|
||||
assertThat(status.isNewTransaction()).isTrue();
|
||||
@@ -151,31 +135,6 @@ class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests {
|
||||
status.setRollbackOnly();
|
||||
assertThat(status.isRollbackOnly()).isTrue();
|
||||
assertThat(status.isCompleted()).isFalse();
|
||||
}
|
||||
}));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
InOrder ordered = inOrder(con);
|
||||
ordered.verify(con).setAutoCommit(false);
|
||||
ordered.verify(con).rollback();
|
||||
ordered.verify(con).setAutoCommit(true);
|
||||
verify(con).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTransactionWithDataAccessExceptionOnRollback() throws Exception {
|
||||
given(con.getAutoCommit()).willReturn(true);
|
||||
willThrow(new SQLException("Cannot rollback")).given(con).rollback();
|
||||
((JdbcTransactionManager) tm).setExceptionTranslator((task, sql, ex) -> new ConcurrencyFailureException(task));
|
||||
TransactionTemplate tt = new TransactionTemplate(tm);
|
||||
|
||||
// specific ConcurrencyFailureException
|
||||
assertThatExceptionOfType(ConcurrencyFailureException.class).isThrownBy(() ->
|
||||
tt.execute(new TransactionCallbackWithoutResult() {
|
||||
@Override
|
||||
protected void doInTransactionWithoutResult(TransactionStatus status) throws RuntimeException {
|
||||
status.setRollbackOnly();
|
||||
}
|
||||
}));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
@@ -187,27 +146,43 @@ class JdbcTransactionManagerTests extends DataSourceTransactionManagerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTransactionWithDataAccessExceptionOnRollbackFromLazyExceptionTranslator() throws Exception {
|
||||
void transactionWithDataAccessExceptionOnRollback() throws Exception {
|
||||
given(con.getAutoCommit()).willReturn(true);
|
||||
willThrow(new SQLException("Cannot rollback")).given(con).rollback();
|
||||
((JdbcTransactionManager) tm).setExceptionTranslator((task, sql, ex) -> new ConcurrencyFailureException(task));
|
||||
TransactionTemplate tt = new TransactionTemplate(tm);
|
||||
|
||||
// specific ConcurrencyFailureException
|
||||
assertThatExceptionOfType(ConcurrencyFailureException.class).isThrownBy(() ->
|
||||
tt.executeWithoutResult(status -> status.setRollbackOnly()));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
InOrder ordered = inOrder(con);
|
||||
ordered.verify(con).setAutoCommit(false);
|
||||
ordered.verify(con).rollback();
|
||||
ordered.verify(con).setAutoCommit(true);
|
||||
verify(con).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void transactionWithDataAccessExceptionOnRollbackFromLazyExceptionTranslator() throws Exception {
|
||||
given(con.getAutoCommit()).willReturn(true);
|
||||
willThrow(new SQLException("Cannot rollback", "40")).given(con).rollback();
|
||||
TransactionTemplate tt = new TransactionTemplate(tm);
|
||||
|
||||
// specific ConcurrencyFailureException
|
||||
assertThatExceptionOfType(ConcurrencyFailureException.class).isThrownBy(() ->
|
||||
tt.execute(new TransactionCallbackWithoutResult() {
|
||||
@Override
|
||||
protected void doInTransactionWithoutResult(TransactionStatus status) throws RuntimeException {
|
||||
assertThat(status.getTransactionName()).isEmpty();
|
||||
assertThat(status.hasTransaction()).isTrue();
|
||||
assertThat(status.isNewTransaction()).isTrue();
|
||||
assertThat(status.isNested()).isFalse();
|
||||
assertThat(status.hasSavepoint()).isFalse();
|
||||
assertThat(status.isReadOnly()).isFalse();
|
||||
assertThat(status.isRollbackOnly()).isFalse();
|
||||
status.setRollbackOnly();
|
||||
assertThat(status.isRollbackOnly()).isTrue();
|
||||
assertThat(status.isCompleted()).isFalse();
|
||||
}
|
||||
tt.executeWithoutResult(status -> {
|
||||
assertThat(status.getTransactionName()).isEmpty();
|
||||
assertThat(status.hasTransaction()).isTrue();
|
||||
assertThat(status.isNewTransaction()).isTrue();
|
||||
assertThat(status.isNested()).isFalse();
|
||||
assertThat(status.hasSavepoint()).isFalse();
|
||||
assertThat(status.isReadOnly()).isFalse();
|
||||
assertThat(status.isRollbackOnly()).isFalse();
|
||||
status.setRollbackOnly();
|
||||
assertThat(status.isRollbackOnly()).isTrue();
|
||||
assertThat(status.isCompleted()).isFalse();
|
||||
}));
|
||||
|
||||
assertThat(TransactionSynchronizationManager.hasResource(ds)).isFalse();
|
||||
|
||||
Reference in New Issue
Block a user