TeslaCN commented on a change in pull request #12909:
URL: https://github.com/apache/shardingsphere/pull/12909#discussion_r722854370



##########
File path: 
shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/ConnectionTransactionTest.java
##########
@@ -0,0 +1,38 @@
+package org.apache.shardingsphere.transaction;
+
+import org.apache.shardingsphere.infra.database.DefaultSchema;
+import 
org.apache.shardingsphere.transaction.ConnectionTransaction.DistributedTransactionOperationType;
+import 
org.apache.shardingsphere.transaction.config.TransactionRuleConfiguration;
+import org.apache.shardingsphere.transaction.context.TransactionContexts;
+import org.apache.shardingsphere.transaction.rule.TransactionRule;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.Map;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public final class ConnectionTransactionTest {
+
+    private ConnectionTransaction connectionTransaction;
+
+    @Before
+    public void init() {
+        Map<String, ShardingSphereTransactionManagerEngine> actualEngines = 
Collections.singletonMap(DefaultSchema.LOGIC_NAME, new 
ShardingSphereTransactionManagerEngine());
+        TransactionContexts transactionContexts = new 
TransactionContexts(actualEngines);
+        connectionTransaction = new ConnectionTransaction(
+                DefaultSchema.LOGIC_NAME,
+                new TransactionRule(new TransactionRuleConfiguration("XA", 
"Atomikos")),
+                transactionContexts
+        );
+    }
+
+    @Test
+    public void testDistributedTransactionOperationTypeIgnore() {

Review comment:
       Name it `assertXXX`.

##########
File path: 
shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/ConnectionTransactionTest.java
##########
@@ -0,0 +1,38 @@
+package org.apache.shardingsphere.transaction;
+
+import org.apache.shardingsphere.infra.database.DefaultSchema;
+import 
org.apache.shardingsphere.transaction.ConnectionTransaction.DistributedTransactionOperationType;
+import 
org.apache.shardingsphere.transaction.config.TransactionRuleConfiguration;
+import org.apache.shardingsphere.transaction.context.TransactionContexts;
+import org.apache.shardingsphere.transaction.rule.TransactionRule;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.Map;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+public final class ConnectionTransactionTest {
+
+    private ConnectionTransaction connectionTransaction;
+
+    @Before
+    public void init() {
+        Map<String, ShardingSphereTransactionManagerEngine> actualEngines = 
Collections.singletonMap(DefaultSchema.LOGIC_NAME, new 
ShardingSphereTransactionManagerEngine());
+        TransactionContexts transactionContexts = new 
TransactionContexts(actualEngines);
+        connectionTransaction = new ConnectionTransaction(
+                DefaultSchema.LOGIC_NAME,
+                new TransactionRule(new TransactionRuleConfiguration("XA", 
"Atomikos")),
+                transactionContexts
+        );
+    }
+
+    @Test
+    public void testDistributedTransactionOperationTypeIgnore() {
+        DistributedTransactionOperationType operationType = 
connectionTransaction.getDistributedTransactionOperationType(false);
+        assertThat(operationType, 
equalTo(DistributedTransactionOperationType.IGNORE));
+    }
+

Review comment:
       Remove the redundant blank line.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to