diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestDisableNameservicesExample.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestDisableNameservicesExample.java index b18e7c084a189..54c9cbda634e5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestDisableNameservicesExample.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/async/TestDisableNameservicesExample.java @@ -73,12 +73,15 @@ @SuppressWarnings("checkstyle:VisibilityModifier") public class TestDisableNameservicesExample { + public static final String ASYNC_MODE = "ASYNC"; + public static final String SYNC_MODE = "SYNC"; + @Nested @ExtendWith(RouterServerHelper.class) class TestWithAsyncRouterRpc { @ParameterizedTest - @ValueSource(strings = {"ASYNC"}) + @ValueSource(strings = {ASYNC_MODE}) public void testMetricsAsync(String rpcMode) throws Exception { testMetrics(); } @@ -101,19 +104,19 @@ public void testWithoutDisablingAsync() throws IOException { class TestWithSyncRouterRpc { @ParameterizedTest - @ValueSource(strings = {"SYNC"}) + @ValueSource(strings = {SYNC_MODE}) public void testMetricsSync(String rpcMode) throws Exception { testMetrics(); } @ParameterizedTest - @ValueSource(strings = {"SYNC"}) + @ValueSource(strings = {SYNC_MODE}) public void testDisablingSync() throws Exception { testDisabling(); } @ParameterizedTest - @ValueSource(strings = {"SYNC"}) + @ValueSource(strings = {SYNC_MODE}) public void testWithoutDisablingSync() throws IOException { testWithoutDisabling(); } @@ -325,9 +328,9 @@ public void beforeEach(ExtensionContext context) throws Exception { ValueSource enumAnnotation = testMethod.getAnnotation(ValueSource.class); if (enumAnnotation != null) { String[] strings = enumAnnotation.strings(); - for (String s : strings) { + for (String rpcMode : strings) { if (TEST_ROUTER_SERVER_TL.get() == null) { - setUp(s); + setUp(rpcMode); } } }