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


##########
solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java:
##########
@@ -53,21 +54,22 @@ public void test() throws Exception {
     QueryRequest request = new QueryRequest(params);
     request.setPath("/admin/cores");
     int which = r.nextInt(clients.size());
-    HttpSolrClient client = (HttpSolrClient) clients.get(which);
-    String previousBaseURL = client.getBaseURL();
-    // Strip /collection1 step from baseURL - requests fail otherwise
-    client.setBaseURL(previousBaseURL.substring(0, 
previousBaseURL.lastIndexOf("/")));
-    NamedList<?> namedListResponse = client.request(request);
-    client.setBaseURL(previousBaseURL); // Restore baseURL
-    NamedList<?> status = (NamedList<?>) namedListResponse.get("status");
-    NamedList<?> collectionStatus = (NamedList<?>) status.getVal(0);
-    String collectionSchema = (String) 
collectionStatus.get(CoreAdminParams.SCHEMA);
-    // Make sure the upgrade to managed schema happened
-    assertEquals(
-        "Schema resource name differs from expected name", 
"managed-schema.xml", collectionSchema);
 
-    SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), 30000);
-    try {
+    // create a client that does not have the /collection1 as part of the URL.
+    try (SolrClient rootClient =
+        new 
HttpSolrClient.Builder(buildUrl(jettys.get(which).getLocalPort())).build()) {
+      NamedList<?> namedListResponse = rootClient.request(request);
+      NamedList<?> status = (NamedList<?>) namedListResponse.get("status");

Review Comment:
   I'd love a suggestion on this, or even a quick commit, as this whole area is 
a bit of dark art to me!



-- 
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]

Reply via email to