You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2021/02/04 10:36:45 UTC
[shardingsphere] branch master updated: Fixes test errors (#9323)
This is an automated email from the ASF dual-hosted git repository.
zhangyonglun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 808921e Fixes test errors (#9323)
808921e is described below
commit 808921ef39f7aa596b32ba76c5d275d761d475c4
Author: Haoran Meng <me...@gmail.com>
AuthorDate: Thu Feb 4 18:36:19 2021 +0800
Fixes test errors (#9323)
---
.../context/transaction/GovernanceTransactionContextsTest.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/shardingsphere-governance/shardingsphere-governance-context/src/test/java/org/apache/shardingsphere/governance/context/transaction/GovernanceTransactionContextsTest.java b/shardingsphere-governance/shardingsphere-governance-context/src/test/java/org/apache/shardingsphere/governance/context/transaction/GovernanceTransactionContextsTest.java
index a6a63c2..90e8fba 100644
--- a/shardingsphere-governance/shardingsphere-governance-context/src/test/java/org/apache/shardingsphere/governance/context/transaction/GovernanceTransactionContextsTest.java
+++ b/shardingsphere-governance/shardingsphere-governance-context/src/test/java/org/apache/shardingsphere/governance/context/transaction/GovernanceTransactionContextsTest.java
@@ -26,7 +26,7 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
import static org.hamcrest.CoreMatchers.is;
@@ -54,9 +54,11 @@ public final class GovernanceTransactionContextsTest {
@Test
public void assertNewInstance() {
when(transactionContexts.getDefaultTransactionManagerEngine()).thenReturn(engine);
- when(transactionContexts.getEngines()).thenReturn(Collections.singletonMap("name", engine));
+ Map<String, ShardingTransactionManagerEngine> engines = new HashMap<>(1, 1);
+ engines.put("name", engine);
+ when(transactionContexts.getEngines()).thenReturn(engines);
GovernanceTransactionContexts actual = new GovernanceTransactionContexts(transactionContexts, XATransactionManagerType.ATOMIKOS.getType());
- assertThat(actual.getEngines(), is(Collections.singletonMap("name", engine)));
+ assertThat(actual.getEngines(), is(engines));
assertThat(actual.getDefaultTransactionManagerEngine(), is(engine));
}