chibenwa commented on code in PR #2399:
URL: https://github.com/apache/james-project/pull/2399#discussion_r1746578725
##########
server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/routes/HealthCheckRoutes.java:
##########
@@ -90,18 +88,26 @@ public void define(Service service) {
}
public Object validateHealthChecks(Request request, Response response) {
- Optional<String> maybeComponentNamesString =
Optional.ofNullable(request.queryParams(QUERY_PARAM_COMPONENT_NAMES));
- Collection<HealthCheck> healthChecks =
maybeComponentNamesString.map(this::getHealthChecks).orElse(healthCheckMap.values());
+ Set<ComponentName> selectedComponentNames =
+
Arrays.stream(Optional.ofNullable(request.queryParamsValues(QUERY_PARAM_COMPONENT_NAMES)).orElse(new
String[0]))
Review Comment:
The over way around is less hacky
```
Optionnal.ofNullable(request.queryParamsValues(QUERY_PARAM_COMPONENT_NAMES))
.map(Stream::of)
.orElse(Stream.empty())
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]