StandardTransactionContexts implements TransactionContexts { @Override public ShardingTransactionManagerEngine getDefaultTransactionManagerEngine() { return engines.get(DefaultSchema.LOGIC_NAME); } StandardTransactionContexts(); @Override ShardingTransactionManagerEngine getDefaultTransactionManagerEngine(); @Override void close();  }
@Test public void assertGetDefaultTransactionManagerEngine() { Map<String, ShardingTransactionManagerEngine> actualEngine = new HashMap<>(); actualEngine.put(DefaultSchema.LOGIC_NAME, new ShardingTransactionManagerEngine()); StandardTransactionContexts standardTransactionContexts = new StandardTransactionContexts(actualEngine); Map<String, ShardingTransactionManagerEngine> engines = standardTransactionContexts.getEngines(); assertThat(engines.size(), is(1)); assertThat(engines, is(actualEngine)); ShardingTransactionManagerEngine defaultEngine = standardTransactionContexts.getDefaultTransactionManagerEngine(); assertNotNull(defaultEngine); }