You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/11/28 15:32:35 UTC

[GitHub] [solr] epugh commented on a diff in pull request #1149: SOLR-16498: Tests to retrieve url from SolrClient

epugh commented on code in PR #1149:
URL: https://github.com/apache/solr/pull/1149#discussion_r1033692635


##########
solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java:
##########
@@ -261,23 +259,22 @@ private NamedList<Object> getIndexVersion(SolrClient s) throws Exception {
     return res;
   }
 
-  private NamedList<Object> reloadCore(SolrClient s, String core) throws Exception {
+  private void reloadCore(JettySolrRunner jettySolrRunner, String core) throws Exception {
 
     ModifiableSolrParams params = new ModifiableSolrParams();
     params.set("action", "reload");
     params.set("core", core);
     params.set("qt", "/admin/cores");
     QueryRequest req = new QueryRequest(params);
 
-    try (SolrClient adminClient = adminClient(s)) {
+    try (SolrClient adminClient = adminClient(jettySolrRunner)) {
       NamedList<Object> res = adminClient.request(req);
       assertNotNull("null response from server", res);
-      return res;
     }
   }
 
-  private SolrClient adminClient(SolrClient client) {
-    String adminUrl = ((HttpSolrClient) client).getBaseURL().replace("/collection1", "");
+  private SolrClient adminClient(JettySolrRunner client) {
+    String adminUrl = client.getBaseUrl().toString().replace("/collection1", "");
     return getHttpSolrClient(adminUrl);
   }

Review Comment:
   Do you want to create a JIRA and associate it with the right other jira's to tackle this in the future?



-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org