You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2017/07/03 11:58:37 UTC

[57/58] [abbrv] lucene-solr:jira/solr-10879: SOLR-10818: Fix bug in construct payload with special characters in testCollectionsApi()

SOLR-10818: Fix bug in construct payload with special characters in testCollectionsApi()


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d070ca60
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d070ca60
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d070ca60

Branch: refs/heads/jira/solr-10879
Commit: d070ca6051bd13e2cee436225139127c7a37f69f
Parents: 20dcb56
Author: Cao Manh Dat <da...@apache.org>
Authored: Mon Jul 3 15:38:05 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Mon Jul 3 15:38:05 2017 +0700

----------------------------------------------------------------------
 .../test/org/apache/solr/handler/V2ApiIntegrationTest.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d070ca60/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
index 844c960..c2b7459 100644
--- a/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/V2ApiIntegrationTest.java
@@ -19,6 +19,7 @@ package org.apache.solr.handler;
 
 
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -138,9 +139,15 @@ public class V2ApiIntegrationTest extends SolrCloudTestCase {
     result = resAsMap(client, new V2Request.Builder("/collections/"+COLL_NAME+"/get/_introspect").build());
     assertEquals("/collections/collection1/get", Utils.getObjectByPath(result, true, "/spec[0]/url/paths[0]"));
     String tempDir = createTempDir().toFile().getPath();
+    Map<String, Object> backupPayload = new HashMap<>();
+    Map<String, Object> backupParams = new HashMap<>();
+    backupPayload.put("backup-collection", backupParams);
+    backupParams.put("name", "backup_test");
+    backupParams.put("collection", COLL_NAME);
+    backupParams.put("location", tempDir);
     client.request(new V2Request.Builder("/c")
         .withMethod(SolrRequest.METHOD.POST)
-        .withPayload("{backup-collection:{name: backup_test, collection: "+COLL_NAME+" , location: '"+tempDir+"' }}")
+        .withPayload(Utils.toJSONString(backupPayload))
         .build());
   }