colvinco commented on code in PR #3023:
URL: https://github.com/apache/solr/pull/3023#discussion_r2029046624


##########
solr/core/src/test/org/apache/solr/handler/admin/api/V2APISmokeTest.java:
##########
@@ -0,0 +1,457 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.handler.admin.api;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.FileEntity;
+import org.apache.http.entity.StringEntity;
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.cloud.SolrCloudTestCase;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.*;
+import java.net.URI;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Path;
+import java.time.Instant;
+import java.util.*;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+public class V2APISmokeTest extends SolrCloudTestCase {
+
+    // TODO: How is this normally done in these tests?
+    private final ObjectMapper objectMapper = new ObjectMapper()
+            .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, 
false);
+    private URL baseUrl;
+    private String baseUrlV2;
+
+    @BeforeClass
+    public static void setupCluster() throws Exception {
+        System.setProperty("enable.packages", "true"); // for file upload
+        System.setProperty("solr.allowPaths", "*"); // for backups
+        configureCluster(2).addConfig("conf", 
configset("cloud-minimal")).configure();
+    }
+
+    @Before
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+        baseUrl = cluster.getJettySolrRunner(0).getBaseUrl();
+        baseUrlV2 = cluster.getJettySolrRunner(0).getBaseURLV2().toString();
+    }
+
+    @AfterClass
+    public static void teardownClass() {
+        System.clearProperty("enable.packages");
+        System.clearProperty("solr.allowPaths");
+    }
+
+    @Test
+    public void testCollectionsApi() throws Exception {
+        canGet("/collections");
+        canPost("/collections", """

Review Comment:
   The one downside is that this can't be backported to the v9 branch as it 
supports Java 11, but I think that's okay given where we are at with this?



-- 
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-unsubscr...@solr.apache.org

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


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

Reply via email to