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


##########
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:
   @YongGoose What you mentioned makes sense. However, I think this PR is just 
a modification of UT. This PR has been pending here for a long time and can be 
merged in first. Subsequently, we submit a sub task to optimize the enumeration 
type.



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