YongGoose commented on code in PR #7482: URL: https://github.com/apache/incubator-seata/pull/7482#discussion_r2177898616
########## spring/src/test/java/org/apache/seata/spring/kt/TransactionScopeTest.kt: ########## @@ -72,62 +82,220 @@ class TransactionScopeTest { return globalStatus } }) + + // Clean up context + RootContext.unbind() + println("BeforeEach: RootContext.getXID() = ${RootContext.getXID()}") + } + + @AfterEach + fun tearDown() { + // Clean up global state to avoid affecting other tests + RootContext.unbind() + + // Restore original TransactionManager + backupTransactionManager?.let { TransactionManagerHolder.set(it) } + } + + @Test + @Throws(NoSuchMethodException::class) Review Comment: Just wondering — what’s the purpose of this annotation? ########## spring/src/test/java/org/apache/seata/spring/kt/TransactionScopeTest.kt: ########## @@ -49,16 +56,19 @@ class TransactionScopeTest { name: String, timeout: Int ): String { + println("Mock TransactionManager.begin() called, returning: $DEFAULT_XID") Review Comment: Using `System.out.println` can degrade performance. Therefore, I believe it’s inappropriate to use it in methods that run repeatedly, such as those annotated with `@BeforeEach`! What do you think?  -- 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: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org