gharris1727 commented on code in PR #15149: URL: https://github.com/apache/kafka/pull/15149#discussion_r1446377748
########## connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/RestServer.java: ########## @@ -226,20 +235,20 @@ protected final void initializeResources() { if (adminListeners == null) { log.info("Adding admin resources to main listener"); adminResourceConfig = resourceConfig; - Collection<ConnectResource> adminResources = adminResources(); - resources.addAll(adminResources); + Collection<Class<?>> adminResources = adminResources(); adminResources.forEach(adminResourceConfig::register); configureAdminResources(adminResourceConfig); } else if (adminListeners.size() > 0) { // TODO: we need to check if these listeners are same as 'listeners' // TODO: the following code assumes that they are different log.info("Adding admin resources to admin listener"); adminResourceConfig = new ResourceConfig(); + adminResourceConfig.register(requestTimeout.binder()); adminResourceConfig.register(new JacksonJsonProvider()); - Collection<ConnectResource> adminResources = adminResources(); - resources.addAll(adminResources); + Collection<Class<?>> adminResources = adminResources(); adminResources.forEach(adminResourceConfig::register); adminResourceConfig.register(ConnectExceptionMapper.class); + adminResourceConfig.property(ServerProperties.WADL_FEATURE_DISABLE, true); Review Comment: this is some light duplication, perhaps the ResourceConfig constructor and the 4 lines accompanying it (request timeout, jackson, exception mapper, and wadl feature disable) can be deduplicated. ########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/resources/ConnectorsResourceTest.java: ########## @@ -159,7 +163,8 @@ public class ConnectorsResourceTest { public void setUp() throws NoSuchMethodException { when(serverConfig.topicTrackingEnabled()).thenReturn(true); when(serverConfig.topicTrackingResetEnabled()).thenReturn(true); - connectorsResource = new ConnectorsResource(herder, serverConfig, restClient); + RestRequestTimeout requestTimeout = () -> RestServer.DEFAULT_REST_REQUEST_TIMEOUT_MS; Review Comment: nit: unused -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org