maple525866 commented on code in PR #7482: URL: https://github.com/apache/incubator-seata/pull/7482#discussion_r2178107485
########## 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: we need to inform the Java compiler that this method may throw a NoSuchMethodException In this test method, it may involve: 1. Reflection operation: Get method and annotation information 2. Spring AOP proxy: Access the method of the proxy object 3. Annotation processing: Process the @GlobalTransactional annotation All these operations may throw a NoSuchMethodException, so use @Throws to declare. -- 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