SeataATShardingTransactionManager implements ShardingTransactionManager { @Override public Connection getConnection(final String dataSourceName) throws SQLException { Preconditions.checkState(enableSeataAT, "sharding seata-at transaction has been disabled."); return dataSourceMap.get(dataSourceName).getConnection(); } SeataATShardingTransactionManager(); @Override void init(final DatabaseType databaseType, final Collection<ResourceDataSource> resourceDataSources); @Override TransactionType getTransactionType(); @Override boolean isInTransaction(); @Override Connection getConnection(final String dataSourceName); @Override @SneakyThrows(TransactionException.class) void begin(); @Override @SneakyThrows(TransactionException.class) void commit(); @Override @SneakyThrows(TransactionException.class) void rollback(); @Override void close();  }
@Test public void assertGetConnection() throws SQLException { Connection actual = seataATShardingTransactionManager.getConnection("demo_ds"); assertThat(actual, instanceOf(ConnectionProxy.class)); }