TransactionStatus { public void setTransactionType(final TransactionType transactionType) { if (inTransaction) { throw new ShardingSphereException("Failed to switch transaction type, please terminate current transaction."); } this.transactionType = transactionType; } TransactionStatus(final TransactionType initialTransactionType); void setTransactionType(final TransactionType transactionType); boolean isInConnectionHeldTransaction();  }
@Test public void assertSetTransactionType() { transactionStatus.setTransactionType(TransactionType.BASE); TransactionType actual = transactionStatus.getTransactionType(); assertThat(actual, is(TransactionType.BASE)); }