jsbxyyx commented on code in PR #7315: URL: https://github.com/apache/incubator-seata/pull/7315#discussion_r2061189945
########## core/src/test/java/org/apache/seata/core/rpc/processor/client/ClientHeartbeatProcessorTest.java: ########## @@ -84,14 +91,14 @@ void process_ShouldLogDebug_WhenReceivePongMessageAndDebugEnabled() throws Excep when(mockChannel.remoteAddress()).thenReturn(mockRemoteAddress); when(mockRpcMessage.getBody()).thenReturn(HeartbeatMessage.PONG); - when(mockLogger.isDebugEnabled()).thenReturn(true); assertTrue(LoggerFactory.getLogger(ClientHeartbeatProcessor.class).isDebugEnabled()); // Act processor.process(mockCtx, mockRpcMessage); // Assert - verify(mockLogger).debug("received PONG from {}", mockRemoteAddress); + assertTrue( + getLogs(Level.DEBUG).stream().anyMatch(log -> log.contains("received PONG from " + mockRemoteAddress))); Review Comment: Determined error messages can use equals ########## core/src/test/java/org/apache/seata/core/rpc/processor/client/RmBranchCommitProcessorTest.java: ########## @@ -134,31 +139,46 @@ void processShouldLogErrorWhenSendFails() throws Exception { processor.process(mockCtx, mockRpcMessage); - verify(mockLogger).error(eq("branch commit error: {}"), eq("Network failure"), eq(simulatedError)); + assertTrue(getLogs(Level.ERROR).stream().anyMatch(log -> log.startsWith("branch commit error:"))); Review Comment: Determined error messages can use equals ########## core/src/test/java/org/apache/seata/core/rpc/processor/client/RmBranchRollbackProcessorTest.java: ########## @@ -155,16 +173,20 @@ void process_ShouldLogError_WhenSendResponseFails() throws Exception { processor.process(mockCtx, mockRpcMessage); // Assert - verify(mockLogger).error(eq("send response error: {}"), eq("Network error"), eq(simulatedError)); + assertTrue(getLogs(Level.ERROR).stream().anyMatch(log -> log.startsWith("send response error:"))); Review Comment: Determined error messages can use equals -- 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