Skip to content

Commit

Permalink
refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
hfutatzhanghb committed Mar 7, 2025
1 parent 831e455 commit 82b67db
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 82b67db

Please sign in to comment.