diff --git a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/autocommit/MySQLAutoCommitTestCase.java b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/autocommit/MySQLAutoCommitTestCase.java index c83052b34933f2..3fcaac3d2b940b 100644 --- a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/autocommit/MySQLAutoCommitTestCase.java +++ b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/transaction/cases/autocommit/MySQLAutoCommitTestCase.java @@ -50,7 +50,9 @@ public void executeTest(final TransactionContainerComposer containerComposer) th private void assertAutoCommit() throws SQLException { // TODO Currently XA transaction does not support two transactions in the same thread at the same time - try (Connection connection1 = getDataSource().getConnection(); Connection connection2 = getDataSource().getConnection()) { + try ( + Connection connection1 = getDataSource().getConnection(); + Connection connection2 = getDataSource().getConnection()) { executeWithLog(connection1, "set session transaction isolation level read committed;"); executeWithLog(connection2, "set session transaction isolation level read committed;"); connection1.setAutoCommit(false); @@ -58,8 +60,7 @@ private void assertAutoCommit() throws SQLException { executeWithLog(connection1, "insert into account(id, balance, transaction_id) values(1, 100, 1);"); assertFalse(executeQueryWithLog(connection2, "select * from account;").next()); connection1.commit(); - Awaitility.await().atMost(1L, TimeUnit.SECONDS).pollDelay(200L, TimeUnit.MILLISECONDS).until( - () -> executeQueryWithLog(connection2, "select * from account;").next()); + Awaitility.await().atMost(1L, TimeUnit.SECONDS).pollDelay(200L, TimeUnit.MILLISECONDS).until(() -> executeQueryWithLog(connection2, "select * from account;").next()); assertTrue(executeQueryWithLog(connection2, "select * from account;").next()); } }