You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2015/09/09 00:35:21 UTC

[06/10] jclouds git commit: JCLOUDS-217: CloudStack do not encode parameters.

JCLOUDS-217: CloudStack do not encode parameters.

Parameters when creating an HTTP request should not be encoded in the
CloudStack tests, as they end up being doubly encoded.


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

Branch: refs/heads/master
Commit: b87ca1b33a013ad6fc11c71d1e1b9795864606f1
Parents: 6df2233
Author: Timur Alperovich <ti...@gmail.com>
Authored: Mon Aug 24 14:33:03 2015 -0700
Committer: Timur Alperovich <ti...@gmail.com>
Committed: Tue Sep 8 15:19:03 2015 -0700

----------------------------------------------------------------------
 .../org/jclouds/cloudstack/features/SSHKeyPairApiTest.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/b87ca1b3/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SSHKeyPairApiTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SSHKeyPairApiTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SSHKeyPairApiTest.java
index b8492e1..3a78a5a 100644
--- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SSHKeyPairApiTest.java
+++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/SSHKeyPairApiTest.java
@@ -20,7 +20,6 @@ import static org.jclouds.reflect.Reflection2.method;
 import static org.testng.Assert.assertEquals;
 
 import java.io.IOException;
-import java.net.URLEncoder;
 
 import org.jclouds.Fallbacks.EmptySetOnNotFoundOr404;
 import org.jclouds.Fallbacks.NullOnNotFoundOr404;
@@ -34,6 +33,7 @@ import org.jclouds.http.functions.ParseFirstJsonValueNamed;
 import org.jclouds.http.functions.ReleasePayloadAndReturn;
 import org.jclouds.rest.internal.GeneratedHttpRequest;
 import org.jclouds.ssh.SshKeys;
+import org.jclouds.util.Strings2;
 import org.testng.annotations.Test;
 
 import com.google.common.base.Functions;
@@ -99,11 +99,11 @@ public class SSHKeyPairApiTest extends BaseCloudStackApiTest<SSHKeyPairApi> {
 
    public void testRegisterSSHKeyPair() throws SecurityException, NoSuchMethodException, IOException {
       Invokable<?, ?> method = method(SSHKeyPairApi.class, "registerSSHKeyPair", String.class, String.class);
-      String publicKey = URLEncoder.encode(SshKeys.generate().get("public"), "UTF-8");
+      String publicKey = SshKeys.generate().get("public");
       GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("jclouds-keypair", publicKey));
       assertRequestLineEquals(httpRequest,
             "GET http://localhost:8080/client/api?response=json&command=registerSSHKeyPair&name=jclouds-keypair&publickey="
-                  + publicKey
+                  + Strings2.urlEncode(publicKey, '/')
                   + " HTTP/1.1");
       assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
       assertPayloadEquals(httpRequest, null, null, false);