Skip to content

Commit

Permalink
Fix null key in QoS (apache#14419)
Browse files Browse the repository at this point in the history
* Fix null key

* Fix style
  • Loading branch information
AlbumenJ authored Jul 12, 2024
1 parent f1da57d commit 6f4fcf4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ private static void appendConfigs(
return;
}

id = id == null ? "(empty)" : id;

plainOutput
.append(type)
.append(": ")
Expand All @@ -194,6 +196,8 @@ private static void appendConfig(
return;
}

id = id == null ? "(empty)" : id;

plainOutput
.append(type)
.append(": ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ void testAll() {
Assertions.assertNotNull(new GetConfig(frameworkModel).execute(commandContext, null));
}

@Test
void testEmptyId() {
FrameworkModel frameworkModel = new FrameworkModel();
ApplicationModel applicationModel1 = frameworkModel.newApplication();

applicationModel1.getApplicationConfigManager().setApplication(new ApplicationConfig("app1"));

ModuleModel moduleModel = applicationModel1.newModule();
ProviderConfig providerConfig1 = new ProviderConfig();
providerConfig1.setThreadname("test");
moduleModel.getConfigManager().addProvider(providerConfig1);

CommandContext commandContext = new CommandContext("getConfig");
commandContext.setHttp(true);

Assertions.assertNotNull(new GetConfig(frameworkModel).execute(commandContext, null));
}

@Test
void testFilter1() {
FrameworkModel frameworkModel = new FrameworkModel();
Expand Down

0 comments on commit 6f4fcf4

Please sign in to comment.