YongGoose commented on code in PR #7288:
URL: https://github.com/apache/incubator-seata/pull/7288#discussion_r2083142487


##########
common/src/test/java/org/apache/seata/common/code/CodeTest.java:
##########
@@ -49,12 +49,18 @@ public void testGetErrorMsgWithInvalidCodeReturnsNull() {
         assertNull(Code.getErrorMsg("404"));
     }
 
-    @Test
-    public void testSetCodeAndMsgUpdatesValuesCorrectly() {
-        // Test case to check if setCode and setMsg are working as expected
-        Code.SUCCESS.setCode("201");
-        Code.SUCCESS.setMsg("Created");
-        assertEquals("201", Code.SUCCESS.getCode());
-        assertEquals("Created", Code.SUCCESS.getMsg());
+    static Stream<Arguments> codeSetterProvider() {
+        return Stream.of(
+                Arguments.of(Code.SUCCESS, "201", "Created")
+        );
+    }
+
+    @ParameterizedTest
+    @MethodSource("codeSetterProvider")
+    public void testSetCodeAndMsgUpdatesValuesCorrectly(Code code, String 
newCode, String newMsg) {
+        code.setCode(newCode);
+        code.setMsg(newMsg);

Review Comment:
   Sounds good to me 🚀



-- 
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

Reply via email to