You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by ra...@apache.org on 2026/10/21 02:25:16 UTC

(dubbo) branch 3.3 updated: Run the tests that have no @Test (#16527)

This is an automated email from the ASF dual-hosted git repository.

RainYuY pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new 843b98b3a1 Run the tests that have no @Test (#16527)
843b98b3a1 is described below

commit 843b98b3a1c70134e965ab04efc2de668238e0b2
Author: Sharang Gupta <sh...@sharanggupta.dev>
AuthorDate: Wed Oct 21 03:25:11 2026 +0100

    Run the tests that have no @Test (#16527)
    
    * Run the tests that have no @Test
    
    ParametersTest lost its test runner when the JUnit 5 migration removed
    "extends TestCase", and RegistryConfigTest.testPreferredWithTrueValue
    never had @Test, unlike testPreferredWithFalseValue. Annotate them so
    they run.
    
    * Remove ParametersTest.testMap2Parameters
    
    It only put values into a HashMap and read them back, so it tested no
    Dubbo code.
    
    * Keep ParametersTest.testMap2Parameters
    
    Restore the test, with @Test so that it runs, as requested in review.
---
 .../test/java/org/apache/dubbo/common/utils/ParametersTest.java   | 8 ++++++--
 .../src/test/java/org/apache/dubbo/config/RegistryConfigTest.java | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ParametersTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ParametersTest.java
index e53a4c7b28..de420d2049 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ParametersTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ParametersTest.java
@@ -19,6 +19,8 @@ package org.apache.dubbo.common.utils;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.junit.jupiter.api.Test;
+
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 class ParametersTest {
@@ -26,7 +28,8 @@ class ParametersTest {
     final String ServiceVersion = "1.0.15";
     final String LoadBalance = "lcr";
 
-    public void testMap2Parameters() {
+    @Test
+    void testMap2Parameters() {
         Map<String, String> map = new HashMap<String, String>();
         map.put("name", "org.apache.dubbo.rpc.service.GenericService");
         map.put("version", "1.0.15");
@@ -37,7 +40,8 @@ class ParametersTest {
         assertEquals(map.get("lb"), LoadBalance);
     }
 
-    public void testString2Parameters() throws Exception {
+    @Test
+    void testString2Parameters() throws Exception {
         String qs = "name=org.apache.dubbo.rpc.service.GenericService&version=1.0.15&lb=lcr";
         Map<String, String> map = StringUtils.parseQueryString(qs);
         assertEquals(map.get("name"), ServiceName);
diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/RegistryConfigTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/RegistryConfigTest.java
index f184d81752..8b589a82e0 100644
--- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/RegistryConfigTest.java
+++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/RegistryConfigTest.java
@@ -237,7 +237,8 @@ class RegistryConfigTest {
         Assertions.assertEquals("zookeeper://localhost:2188", registryConfig.getAddress());
     }
 
-    public void testPreferredWithTrueValue() {
+    @Test
+    void testPreferredWithTrueValue() {
         RegistryConfig registry = new RegistryConfig();
         registry.setPreferred(true);
         Map<String, String> map = new HashMap<>();