JCLOUDS-217: Cloudstack: avoid encoded strings.

jclouds should not use encoded strings in tests for Cloudstack.
This commit is contained in:
Timur Alperovich 2015-09-11 13:40:29 -07:00
parent 075c912d87
commit 7151a3875b
15 changed files with 389 additions and 316 deletions

View File

@ -56,7 +56,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("command", "queryAsyncJobResult")
.addQueryParam("jobid", "50006")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "v8BWKMxd%2BIzHIuTaZ9sNSzCWqFI%3D")
.addQueryParam("signature", "v8BWKMxd+IzHIuTaZ9sNSzCWqFI=")
.addHeader("Accept", "application/json")
.build();
@ -74,7 +74,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("command", "queryAsyncJobResult")
.addQueryParam("jobid", "13330fc9-8b3e-4582-aa3e-90883c041010")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "y4gk3ckWAMPDNZM26LUK0gAhfiE%3D")
.addQueryParam("signature", "y4gk3ckWAMPDNZM26LUK0gAhfiE=")
.addHeader("Accept", "application/json")
.build();
@ -87,7 +87,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("response", "json")
.addQueryParam("command", "listCapabilities")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "l3PVoJnKK2G2gHk3HPHtpwWjlW4%3D")
.addQueryParam("signature", "l3PVoJnKK2G2gHk3HPHtpwWjlW4=")
.addHeader("Accept", "application/json")
.build();
@ -104,7 +104,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("networkids", "204")
.addQueryParam("group", "test")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "M2Wx0CgOeH9vYHhbcbblwziqpwI%3D")
.addQueryParam("signature", "M2Wx0CgOeH9vYHhbcbblwziqpwI=")
.addHeader("Accept", "application/json")
.build();
@ -149,7 +149,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("group", "test")
.addQueryParam("keypair", "mykeypair")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "D3qQlTNjxrBXeG82C7YPrwU1jMc%3D")
.addQueryParam("signature", "D3qQlTNjxrBXeG82C7YPrwU1jMc=")
.addHeader("Accept", "application/json")
.build();
@ -197,7 +197,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("group", "test")
.addQueryParam("keypair", "jclouds-test")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "kfU/J/REa4DdYj0b/pSjuB3h3Qc%3D")
.addQueryParam("signature", "kfU/J/REa4DdYj0b/pSjuB3h3Qc=")
.addHeader("Accept", "application/json")
.build();
@ -244,7 +244,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("group", "test")
.addQueryParam("keypair", "mykeypair")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "5qkUSGh0y%2BP/t04/j3%2BEN9PAeFI%3D")
.addQueryParam("signature", "5qkUSGh0y+P/t04/j3+EN9PAeFI=")
.addHeader("Accept", "application/json")
.build();
@ -297,7 +297,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("diskofferingid", "5678")
.addQueryParam("size", "10")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "lDzBXtVKCktueskyI/haID9ohJU%3D")
.addQueryParam("signature", "lDzBXtVKCktueskyI/haID9ohJU=")
.addHeader("Accept", "application/json")
.build();
@ -352,7 +352,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("keypair", "mykeypair")
.addQueryParam("securitygroupids", "30")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "rz8V/tMk/UbxUhNqp7Bq3CrSg/k%3D")
.addQueryParam("signature", "rz8V/tMk/UbxUhNqp7Bq3CrSg/k=")
.addHeader("Accept", "application/json")
.build();
@ -411,7 +411,7 @@ public class CloudStackComputeServiceAdapterExpectTest extends BaseCloudStackCom
.addQueryParam("group", "test")
.addQueryParam("keypair", "mykeypair")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "hGV6gZZakwvNKhTJurkm48%2Bzgso%3D")
.addQueryParam("signature", "hGV6gZZakwvNKhTJurkm48+zgso=")
.addHeader("Accept", "application/json")
.build();

View File

@ -54,7 +54,7 @@ public class CloudStackImageExtensionExpectTest extends BaseCloudStackComputeSer
.addQueryParam("listAll", "true")
.addQueryParam("id", "3239ade9-fd25-405c-8eda-59f0313a3fb0")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "Qq7Br3qNsyr5ifWZHIrLAslhwm0%3D")
.addQueryParam("signature", "Qq7Br3qNsyr5ifWZHIrLAslhwm0=")
.addHeader("Accept", "application/json")
.build();
@ -68,7 +68,7 @@ public class CloudStackImageExtensionExpectTest extends BaseCloudStackComputeSer
.addQueryParam("command", "stopVirtualMachine")
.addQueryParam("id", "3239ade9-fd25-405c-8eda-59f0313a3fb0")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "y9vxRK61K8sDoWtvSJHIx5WO9AE%3D")
.addQueryParam("signature", "y9vxRK61K8sDoWtvSJHIx5WO9AE=")
.addHeader("Accept", "application/json")
.build();
@ -82,7 +82,7 @@ public class CloudStackImageExtensionExpectTest extends BaseCloudStackComputeSer
.addQueryParam("command", "queryAsyncJobResult")
.addQueryParam("jobid", "a7d5127b-24a2-4a44-a4a7-25a6d057b453")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "CVpnN%2FSbx%2FMCOOyj%2FoVAt3bn684%3D")
.addQueryParam("signature", "CVpnN/Sbx/MCOOyj/oVAt3bn684=")
.addHeader("Accept", "application/json")
.build();
@ -97,7 +97,7 @@ public class CloudStackImageExtensionExpectTest extends BaseCloudStackComputeSer
.addQueryParam("listAll", "true")
.addQueryParam("virtualmachineid", "3239ade9-fd25-405c-8eda-59f0313a3fb0")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "drLPf9NE9ROZPOfeDkASiKa50t8%3D")
.addQueryParam("signature", "drLPf9NE9ROZPOfeDkASiKa50t8=")
.addHeader("Accept", "application/json")
.build();
@ -115,7 +115,7 @@ public class CloudStackImageExtensionExpectTest extends BaseCloudStackComputeSer
.addQueryParam("ostypeid", "45de18f1-87c6-4646-8099-95c61f2a300a")
.addQueryParam("displaytext", "temp-template-ignore")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "madHsBgxjYbM6JnZKYWajOlfPlY%3D")
.addQueryParam("signature", "madHsBgxjYbM6JnZKYWajOlfPlY=")
.addHeader("Accept", "application/json")
.build();
@ -129,7 +129,7 @@ public class CloudStackImageExtensionExpectTest extends BaseCloudStackComputeSer
.addQueryParam("command", "queryAsyncJobResult")
.addQueryParam("jobid", "4e345230-8fcc-48a3-8a37-c5fe960df671")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "6mTKL9fjz7bn6C7tOaZBzKdZwHs%3D")
.addQueryParam("signature", "6mTKL9fjz7bn6C7tOaZBzKdZwHs=")
.addHeader("Accept", "application/json")
.build();
@ -145,7 +145,7 @@ public class CloudStackImageExtensionExpectTest extends BaseCloudStackComputeSer
.addQueryParam("templatefilter", "executable")
.addQueryParam("id", "3dc6ce25-a6cf-4d60-a664-3499993b511b")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "dXv%2Bl04EDd7hmrWv5CdW8v298RE%3D")
.addQueryParam("signature", "dXv+l04EDd7hmrWv5CdW8v298RE=")
.addHeader("Accept", "application/json")
.build();

View File

@ -67,7 +67,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("command", "queryAsyncJobResult")
.addQueryParam("jobid", "13330fc9-8b3e-4582-aa3e-90883c041010")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "y4gk3ckWAMPDNZM26LUK0gAhfiE%3D")
.addQueryParam("signature", "y4gk3ckWAMPDNZM26LUK0gAhfiE=")
.addHeader("Accept", "application/json")
.build();
@ -82,7 +82,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("listAll", "true")
.addQueryParam("id", "13")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "TmlGaO2ICM%2BiXQr88%2BZCyWUniSw%3D")
.addQueryParam("signature", "TmlGaO2ICM+iXQr88+ZCyWUniSw=")
.addHeader("Accept", "application/json")
.build();
@ -104,7 +104,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("command", "listSecurityGroups")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "o%2Bd8xxWT1Pa%2BI57SG2caFAblBYA%3D")
.addQueryParam("signature", "o+d8xxWT1Pa+I57SG2caFAblBYA=")
.addHeader("Accept", "application/json")
.build();
@ -138,7 +138,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("listAll", "true")
.addQueryParam("virtualmachineid", "some-node")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "x4f9fGMjIHXl5biaaFK5oOEONcg%3D")
.addQueryParam("signature", "x4f9fGMjIHXl5biaaFK5oOEONcg=")
.addHeader("Accept", "application/json")
.build();
@ -172,7 +172,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("listAll", "true")
.addQueryParam("id", "13")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "TmlGaO2ICM%2BiXQr88%2BZCyWUniSw%3D")
.addQueryParam("signature", "TmlGaO2ICM+iXQr88+ZCyWUniSw=")
.addHeader("Accept", "application/json")
.build();
@ -207,7 +207,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("listAll", "true")
.addQueryParam("securitygroupname", "jclouds-test")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "zGp2rfHY6fBIGkgODRxyNzFfPFI%3D")
.addQueryParam("signature", "zGp2rfHY6fBIGkgODRxyNzFfPFI=")
.addHeader("Accept", "application/json")
.build();
@ -245,7 +245,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("listAll", "true")
.addQueryParam("securitygroupname", "jclouds-test")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "zGp2rfHY6fBIGkgODRxyNzFfPFI%3D")
.addQueryParam("signature", "zGp2rfHY6fBIGkgODRxyNzFfPFI=")
.addHeader("Accept", "application/json")
.build();
@ -281,7 +281,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("listAll", "true")
.addQueryParam("id", "13")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "TmlGaO2ICM%2BiXQr88%2BZCyWUniSw%3D")
.addQueryParam("signature", "TmlGaO2ICM+iXQr88+ZCyWUniSw=")
.addHeader("Accept", "application/json")
.build();
@ -295,7 +295,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("command", "deleteSecurityGroup")
.addQueryParam("id", "13")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "S1A2lYR/ibf4%2BHGFxVLdZvXZujQ%3D")
.addQueryParam("signature", "S1A2lYR/ibf4+HGFxVLdZvXZujQ=")
.addHeader("Accept", "application/json")
.build();
@ -329,7 +329,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("listAll", "true")
.addQueryParam("id", "14")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "pWQ30A6l5qh4eaNypGwM9FoLnUM%3D")
.addQueryParam("signature", "pWQ30A6l5qh4eaNypGwM9FoLnUM=")
.addHeader("Accept", "application/json")
.build();
@ -364,7 +364,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("endport", "11")
.addQueryParam("cidrlist", "1.1.1.1/24")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "XyokGNutHwcyU7KQVFZOTHvc4RY%3D")
.addQueryParam("signature", "XyokGNutHwcyU7KQVFZOTHvc4RY=")
.addHeader("Accept", "application/json")
.build();
@ -413,7 +413,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("endport", "11")
.addQueryParam("cidrlist", "1.1.1.1/24")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "XyokGNutHwcyU7KQVFZOTHvc4RY%3D")
.addQueryParam("signature", "XyokGNutHwcyU7KQVFZOTHvc4RY=")
.addHeader("Accept", "application/json")
.build();
@ -455,7 +455,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("usersecuritygrouplist[0].account", "adrian")
.addQueryParam("usersecuritygrouplist[0].group", "adriancole")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "v2OgKc2IftwX9pfKq2Pw/Z2xh9w%3D")
.addQueryParam("signature", "v2OgKc2IftwX9pfKq2Pw/Z2xh9w=")
.addHeader("Accept", "application/json")
.build();
@ -507,7 +507,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("usersecuritygrouplist[0].account", "adrian")
.addQueryParam("usersecuritygrouplist[0].group", "adriancole")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "v2OgKc2IftwX9pfKq2Pw/Z2xh9w%3D")
.addQueryParam("signature", "v2OgKc2IftwX9pfKq2Pw/Z2xh9w=")
.addHeader("Accept", "application/json")
.build();
@ -549,7 +549,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("command", "revokeSecurityGroupIngress")
.addQueryParam("id", "6")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "H7cY/MEYGN7df1hiz0mMAFVBfa8%3D")
.addQueryParam("signature", "H7cY/MEYGN7df1hiz0mMAFVBfa8=")
.addHeader("Accept", "application/json")
.build();
@ -586,7 +586,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("command", "revokeSecurityGroupIngress")
.addQueryParam("id", "6")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "H7cY/MEYGN7df1hiz0mMAFVBfa8%3D")
.addQueryParam("signature", "H7cY/MEYGN7df1hiz0mMAFVBfa8=")
.addHeader("Accept", "application/json")
.build();
@ -616,7 +616,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("command", "revokeSecurityGroupIngress")
.addQueryParam("id", "5")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "bEzvrLtO7aEWkIqJgUeTnd%2B0XbY%3D")
.addQueryParam("signature", "bEzvrLtO7aEWkIqJgUeTnd+0XbY=")
.addHeader("Accept", "application/json")
.build();
@ -653,7 +653,7 @@ public class CloudStackSecurityGroupExtensionExpectTest extends BaseCloudStackCo
.addQueryParam("command", "revokeSecurityGroupIngress")
.addQueryParam("id", "5")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "bEzvrLtO7aEWkIqJgUeTnd%2B0XbY%3D")
.addQueryParam("signature", "bEzvrLtO7aEWkIqJgUeTnd+0XbY=")
.addHeader("Accept", "application/json")
.build();

View File

@ -19,7 +19,6 @@ package org.jclouds.cloudstack.features;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import java.net.URI;
import java.util.Set;
import com.google.common.collect.ImmutableSet;
@ -43,9 +42,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=listFirewallRules&listAll=true&" +
"apiKey=identity&signature=9%2BtdTXe2uYLzAexPNgrMy5Tq8hE%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listFirewallRules")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "9+tdTXe2uYLzAexPNgrMy5Tq8hE=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -73,9 +75,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=listFirewallRules&listAll=true&" +
"apiKey=identity&signature=9%2BtdTXe2uYLzAexPNgrMy5Tq8hE%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listFirewallRules")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "9+tdTXe2uYLzAexPNgrMy5Tq8hE=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -89,9 +94,13 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=listFirewallRules&listAll=true&" +
"id=2017&apiKey=identity&signature=6coh9Qdwla94TN1Dl008WlhzZUY%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listFirewallRules")
.addQueryParam("listAll", "true")
.addQueryParam("id", "2017")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "6coh9Qdwla94TN1Dl008WlhzZUY=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -110,9 +119,13 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=listFirewallRules&listAll=true&" +
"id=4&apiKey=identity&signature=rYd8gr7ptdSZlIehBEMQEKsm07Q%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listFirewallRules")
.addQueryParam("listAll", "true")
.addQueryParam("id", "4")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "rYd8gr7ptdSZlIehBEMQEKsm07Q=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -126,9 +139,13 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=createFirewallRule&" +
"ipaddressid=2&protocol=TCP&apiKey=identity&signature=d0MZ/yhQPAaV%2BYQmfZsQtQL2C28%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "createFirewallRule")
.addQueryParam("ipaddressid", "2")
.addQueryParam("protocol", "TCP")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "d0MZ/yhQPAaV+YQmfZsQtQL2C28=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -145,9 +162,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=deleteFirewallRule&id=2015&apiKey=identity&signature=/T5FAO2yGPctaPmg7TEtIEFW3EU%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "deleteFirewallRule")
.addQueryParam("id", "2015")
.addQueryParam("apiKey", "identity").
addQueryParam("signature", "/T5FAO2yGPctaPmg7TEtIEFW3EU=")
.build(),
HttpResponse.builder()
.statusCode(200)
@ -161,9 +181,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=listPortForwardingRules&listAll=true&apiKey=identity&signature=8SXGJZWdcJfVz4V90Pyod12x9dM%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listPortForwardingRules")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "8SXGJZWdcJfVz4V90Pyod12x9dM=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -191,9 +214,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=listPortForwardingRules&listAll=true&apiKey=identity&signature=8SXGJZWdcJfVz4V90Pyod12x9dM%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listPortForwardingRules")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "8SXGJZWdcJfVz4V90Pyod12x9dM=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -207,9 +233,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=listPortForwardingRules&listAll=true&id=15&apiKey=identity&signature=JL63p6cJzbb9vaffeV4u60IGlWE%3D"))
.endpoint("http://localhost:8080/client/api").addQueryParam("response", "json")
.addQueryParam("command", "listPortForwardingRules")
.addQueryParam("listAll", "true")
.addQueryParam("id", "15")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "JL63p6cJzbb9vaffeV4u60IGlWE=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -231,9 +260,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=listPortForwardingRules&listAll=true&id=4&apiKey=identity&signature=4blbBVn2%2BZfF8HwoglbmtYoDAjs%3D"))
.endpoint("http://localhost:8080/client/api").addQueryParam("response", "json")
.addQueryParam("command", "listPortForwardingRules")
.addQueryParam("listAll", "true")
.addQueryParam("id", "4")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "4blbBVn2+ZfF8HwoglbmtYoDAjs=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -255,7 +287,7 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
.addQueryParam("virtualmachineid", "1234")
.addQueryParam("privateport", "22")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "84dtGzQp0G6k3z3Gkc3F/HBNS2Y%3D")
.addQueryParam("signature", "84dtGzQp0G6k3z3Gkc3F/HBNS2Y=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -273,9 +305,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=deletePortForwardingRule&id=2015&apiKey=identity&signature=2UE7KB3wm5ocmR%2BGMNFKPKfiDo8%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "deletePortForwardingRule")
.addQueryParam("id", "2015")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "2UE7KB3wm5ocmR+GMNFKPKfiDo8=")
.build(),
HttpResponse.builder()
.statusCode(200)
@ -289,9 +324,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=listEgressFirewallRules&listAll=true&" +
"apiKey=identity&signature=j3OpRXs7mEwVKs9KIb4ncRKVO9A%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listEgressFirewallRules")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "j3OpRXs7mEwVKs9KIb4ncRKVO9A=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -319,9 +357,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=listEgressFirewallRules&listAll=true&" +
"apiKey=identity&signature=j3OpRXs7mEwVKs9KIb4ncRKVO9A%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listEgressFirewallRules")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "j3OpRXs7mEwVKs9KIb4ncRKVO9A=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -335,9 +376,13 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=listEgressFirewallRules&listAll=true&" +
"id=2017&apiKey=identity&signature=Hi1K5VA3yd3mk0AmgJ2F6y%2BVzMo%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listEgressFirewallRules")
.addQueryParam("listAll", "true")
.addQueryParam("id", "2017")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "Hi1K5VA3yd3mk0AmgJ2F6y+VzMo=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -356,9 +401,13 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=listEgressFirewallRules&listAll=true&" +
"id=4&apiKey=identity&signature=dzb5azKxXZsuGrNRJbRHfna7FMo%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listEgressFirewallRules")
.addQueryParam("listAll", "true")
.addQueryParam("id", "4")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "dzb5azKxXZsuGrNRJbRHfna7FMo=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -372,9 +421,13 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=createEgressFirewallRule&" +
"networkid=2&protocol=TCP&apiKey=identity&signature=I/OJEqiLp8ZHlZskKUiT5uTRE3M%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "createEgressFirewallRule")
.addQueryParam("networkid", "2")
.addQueryParam("protocol", "TCP")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "I/OJEqiLp8ZHlZskKUiT5uTRE3M=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -391,9 +444,12 @@ public class FirewallApiExpectTest extends BaseCloudStackExpectTest<FirewallApi>
FirewallApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=deleteEgressFirewallRule&id=2015&apiKey=identity&signature=S119WNmamKwc5d9qvvkIJznXytg%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "deleteEgressFirewallRule")
.addQueryParam("id", "2015")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "S119WNmamKwc5d9qvvkIJznXytg=")
.build(),
HttpResponse.builder()
.statusCode(200)

View File

@ -97,14 +97,14 @@ public class GlobalHostApiExpectTest extends BaseCloudStackExpectTest<GlobalHost
.addQueryParam("response", "json")
.addQueryParam("command", "addHost")
.addQueryParam("zoneid", "1")
.addQueryParam("url", "http%3A//example.com")
.addQueryParam("url", "http://example.com")
.addQueryParam("hypervisor", "XenServer")
.addQueryParam("username", "fred")
.addQueryParam("password", "sekrit")
.addQueryParam("hosttags", "")
.addQueryParam("allocationstate", "Enabled")
.addQueryParam("clusterid", "1")
.addQueryParam("clustername", "Xen%20Clust%201")
.addQueryParam("clustername", "Xen Clust 1")
.addQueryParam("podid", "1")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "ExGaljKKQIlVbWk5hd0BnnjmBzs=")
@ -334,7 +334,7 @@ public class GlobalHostApiExpectTest extends BaseCloudStackExpectTest<GlobalHost
.addQueryParam("username", "fred")
.addQueryParam("password", "sekrit")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "xwc83%2BoYK0cuAiFQAlg/7/1IVHE=")
.addQueryParam("signature", "xwc83+oYK0cuAiFQAlg/7/1IVHE=")
.addHeader("Accept", "application/json").build();
@Test

View File

@ -42,7 +42,7 @@ public class GlobalUserApiTest extends BaseCloudStackApiTest<GlobalUserApi> {
.addQueryParam("command", "createUser")
.addQueryParam("username", "user")
.addQueryParam("account", "account")
.addQueryParam("email", "email%40example.com")
.addQueryParam("email", "email@example.com")
.addQueryParam("password", "hashed-password")
.addQueryParam("firstname", "FirstName")
.addQueryParam("lastname", "LastName").build();

View File

@ -20,8 +20,6 @@ import static org.jclouds.cloudstack.options.UpdateZoneOptions.Builder.name;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import java.net.URI;
import org.jclouds.cloudstack.CloudStackContext;
import org.jclouds.cloudstack.domain.AllocationState;
import org.jclouds.cloudstack.domain.NetworkType;
@ -49,7 +47,7 @@ public class GlobalZoneApiExpectTest extends BaseCloudStackExpectTest<GlobalZone
.addQueryParam("dns1", "8.8.8.8")
.addQueryParam("internaldns1", "10.10.10.10")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "hWNmM2%2BTsfb5DelQa/GJLN5DVWE=")
.addQueryParam("signature", "hWNmM2+Tsfb5DelQa/GJLN5DVWE=")
.addHeader("Accept", "application/json").build();
public void testCreateZoneWhenResponseIs2xxAnd404() {
@ -78,13 +76,15 @@ public class GlobalZoneApiExpectTest extends BaseCloudStackExpectTest<GlobalZone
public void testUpdateZoneWhenResponseIs2xxAnd404() {
HttpRequest request = HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&command=updateZone&" +
"id=6&name=test-zone&dns1=8.8.8.8&apiKey=identity&signature=v19FdHKHztdT0IRloYFFn0eNbWM%3D"))
.headers(
ImmutableMultimap.<String, String>builder()
.put("Accept", "application/json")
.build())
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "updateZone")
.addQueryParam("id", "6")
.addQueryParam("name", "test-zone")
.addQueryParam("dns1", "8.8.8.8")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "v19FdHKHztdT0IRloYFFn0eNbWM=")
.headers(ImmutableMultimap.<String, String>builder().put("Accept", "application/json").build())
.build();
GlobalZoneApi client = requestSendsResponse(request,
@ -113,9 +113,12 @@ public class GlobalZoneApiExpectTest extends BaseCloudStackExpectTest<GlobalZone
GlobalZoneApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=deleteZone&id=6&apiKey=identity&signature=TfkzSIK8kzGJnIYo3DofECyuOII%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "deleteZone")
.addQueryParam("id", "6")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "TfkzSIK8kzGJnIYo3DofECyuOII=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()

View File

@ -76,7 +76,7 @@ public class ISOApiExpectTest extends BaseCloudStackExpectTest<ISOApi> {
.addQueryParam("command", "listIsos")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "qUUF6hCDc57Bc/nHriS9umbZBKA%3D")
.addQueryParam("signature", "qUUF6hCDc57Bc/nHriS9umbZBKA=")
.addHeader("Accept", "application/json")
.build();
@ -113,10 +113,10 @@ public class ISOApiExpectTest extends BaseCloudStackExpectTest<ISOApi> {
.addQueryParam("ispublic", "true")
.addQueryParam("isready", "true")
.addQueryParam("keyword", "bob")
.addQueryParam("name", "bob%27s%20iso")
.addQueryParam("name", "bob's iso")
.addQueryParam("zoneid", "7")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "4S5ustbaBErEnpymWLSj1rEJ/nk%3D")
.addQueryParam("signature", "4S5ustbaBErEnpymWLSj1rEJ/nk=")
.addHeader("Accept", "application/json")
.build();
@ -137,7 +137,7 @@ public class ISOApiExpectTest extends BaseCloudStackExpectTest<ISOApi> {
.addQueryParam("listAll", "true")
.addQueryParam("id", "018e0928-8205-4d8e-9329-f731a9ccd488")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "uZyPUJt6ThMDcQSDa%2BEv5LMs%2B2U%3D")
.addQueryParam("signature", "uZyPUJt6ThMDcQSDa+Ev5LMs+2U=")
.addHeader("Accept", "application/json")
.build();
@ -176,7 +176,7 @@ public class ISOApiExpectTest extends BaseCloudStackExpectTest<ISOApi> {
.addQueryParam("ispublic", "true")
.addQueryParam("ostypeid", "1234-abcd")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "YpFMYUUu0daLgwxNFubVfkV0Nw8%3D")
.addQueryParam("signature", "YpFMYUUu0daLgwxNFubVfkV0Nw8=")
.addHeader("Accept", "application/json")
.build();

View File

@ -173,12 +173,12 @@ public class SecurityGroupApiTest extends BaseCloudStackApiTest<SecurityGroupApi
.addQueryParam("protocol", "tcp")
.addQueryParam("startport", "22")
.addQueryParam("endport", "22")
.addQueryParam("usersecuritygrouplist%5B0%5D.account", "adrian")
.addQueryParam("usersecuritygrouplist%5B0%5D.group", "group1")
.addQueryParam("usersecuritygrouplist%5B1%5D.account", "adrian")
.addQueryParam("usersecuritygrouplist%5B1%5D.group", "group2")
.addQueryParam("usersecuritygrouplist%5B2%5D.account", "bob")
.addQueryParam("usersecuritygrouplist%5B2%5D.group", "group1").build();
.addQueryParam("usersecuritygrouplist[0].account", "adrian")
.addQueryParam("usersecuritygrouplist[0].group", "group1")
.addQueryParam("usersecuritygrouplist[1].account", "adrian")
.addQueryParam("usersecuritygrouplist[1].group", "group2")
.addQueryParam("usersecuritygrouplist[2].account", "bob")
.addQueryParam("usersecuritygrouplist[2].group", "group1").build();
public void testAuthorizeIngressPortsToSecurityGroups() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(SecurityGroupApi.class, "authorizeIngressPortsToSecurityGroups", String.class,
@ -233,12 +233,12 @@ public class SecurityGroupApiTest extends BaseCloudStackApiTest<SecurityGroupApi
.addQueryParam("securitygroupid", "2")
.addQueryParam("icmpcode", "22")
.addQueryParam("icmptype", "22")
.addQueryParam("usersecuritygrouplist%5B0%5D.account", "adrian")
.addQueryParam("usersecuritygrouplist%5B0%5D.group", "group1")
.addQueryParam("usersecuritygrouplist%5B1%5D.account", "adrian")
.addQueryParam("usersecuritygrouplist%5B1%5D.group", "group2")
.addQueryParam("usersecuritygrouplist%5B2%5D.account", "bob")
.addQueryParam("usersecuritygrouplist%5B2%5D.group", "group1").build();
.addQueryParam("usersecuritygrouplist[0].account", "adrian")
.addQueryParam("usersecuritygrouplist[0].group", "group1")
.addQueryParam("usersecuritygrouplist[1].account", "adrian")
.addQueryParam("usersecuritygrouplist[1].group", "group2")
.addQueryParam("usersecuritygrouplist[2].account", "bob")
.addQueryParam("usersecuritygrouplist[2].group", "group1").build();
public void testAuthorizeIngressICMPToSecurityGroups() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(SecurityGroupApi.class, "authorizeIngressICMPToSecurityGroups", String.class,

View File

@ -118,7 +118,15 @@ public class SnapshotApiTest extends BaseCloudStackApiTest<SnapshotApi> {
public void testListSnapshotsOptions() throws NoSuchMethodException {
Invokable<?, ?> method = method(SnapshotApi.class, "listSnapshots", ListSnapshotsOptions[].class);
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(ListSnapshotsOptions.Builder.accountInDomain("acc", "7").id("5").interval(Snapshot.Interval.MONTHLY).isRecursive(true).keyword("fred").name("fred's snapshot").snapshotType(Snapshot.Type.RECURRING).volumeId("11")));
GeneratedHttpRequest httpRequest = processor.createRequest(method,
ImmutableList.<Object> of(ListSnapshotsOptions.Builder.accountInDomain("acc", "7")
.id("5")
.interval(Snapshot.Interval.MONTHLY)
.isRecursive(true)
.keyword("fred")
.name("fred's snapshot")
.snapshotType(Snapshot.Type.RECURRING)
.volumeId("11")));
assertRequestLineEquals(httpRequest,
"GET http://localhost:8080/client/api?response=json&command=listSnapshots&listAll=true&account=acc&domainid=7&id=5&intervaltype=MONTHLY&isrecursive=true&keyword=fred&name=fred%27s%20snapshot&snapshottype=RECURRING&volumeid=11 HTTP/1.1");
@ -156,7 +164,7 @@ public class SnapshotApiTest extends BaseCloudStackApiTest<SnapshotApi> {
.addQueryParam("timezone", "UTC")
.addQueryParam("volumeid", "12")
.addQueryParam("intervaltype", "MONTHLY")
.addQueryParam("schedule", "07%3A06%3A05").build();
.addQueryParam("schedule", "07:06:05").build();
public void testCreateSnapshotPolicy() throws NoSuchMethodException {
Invokable<?, ?> method = method(SnapshotApi.class, "createSnapshotPolicy", SnapshotPolicySchedule.class, String.class, String.class, String.class);

View File

@ -16,10 +16,8 @@
*/
package org.jclouds.cloudstack.features;
import static org.jclouds.util.Strings2.urlEncode;
import static org.testng.Assert.assertEquals;
import java.net.URI;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@ -48,7 +46,7 @@ public class TagApiExpectTest extends BaseCloudStackExpectTest<TagApi> {
.addQueryParam("command", "listTags")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "amvtC2a0VHzzDF5SUAIOZpXHd0A%3D")
.addQueryParam("signature", "amvtC2a0VHzzDF5SUAIOZpXHd0A=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -75,10 +73,12 @@ public class TagApiExpectTest extends BaseCloudStackExpectTest<TagApi> {
TagApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=listTags&listAll=true&apiKey=identity&signature=amvtC2a0VHzzDF5SUAIOZpXHd0A%3D")
)
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listTags")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "amvtC2a0VHzzDF5SUAIOZpXHd0A=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -96,10 +96,10 @@ public class TagApiExpectTest extends BaseCloudStackExpectTest<TagApi> {
.addQueryParam("command", "createTags")
.addQueryParam("resourcetype", "Template")
.addQueryParam("resourceids", "52d89d5d-6070-4fd4-8131-c6c9ca4b062e")
.addQueryParam(urlEncode("tags[0].key"), "some-tag")
.addQueryParam(urlEncode("tags[0].value"), "some-value")
.addQueryParam("tags[0].key", "some-tag")
.addQueryParam("tags[0].value", "some-value")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "HDGTKGG9kONEwh5xlLe9R72z%2B9Q%3D")
.addQueryParam("signature", "HDGTKGG9kONEwh5xlLe9R72z+9Q=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -125,10 +125,10 @@ public class TagApiExpectTest extends BaseCloudStackExpectTest<TagApi> {
.addQueryParam("command", "deleteTags")
.addQueryParam("resourcetype", "Template")
.addQueryParam("resourceids", "52d89d5d-6070-4fd4-8131-c6c9ca4b062e")
.addQueryParam(urlEncode("tags[0].key"), "some-tag")
.addQueryParam(urlEncode("tags[0].value"), "some-value")
.addQueryParam("tags[0].key", "some-tag")
.addQueryParam("tags[0].value", "some-value")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "inAqWH/GkkGipkZFG5Wfmxa8vOE%3D")
.addQueryParam("signature", "inAqWH/GkkGipkZFG5Wfmxa8vOE=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()

View File

@ -92,7 +92,7 @@ public class TemplateApiTest extends BaseCloudStackApiTest<TemplateApi> {
.addQueryParam("command", "registerTemplate")
.addQueryParam("format", "QCOW2")
.addQueryParam("hypervisor", "xen")
.addQueryParam("url", "http%3A//example.com/")
.addQueryParam("url", "http://example.com/")
.addQueryParam("zoneid", "20")
.addQueryParam("name", "thename")
.addQueryParam("ostypeid", "10")
@ -119,7 +119,7 @@ public class TemplateApiTest extends BaseCloudStackApiTest<TemplateApi> {
.addQueryParam("command", "registerTemplate")
.addQueryParam("format", "QCOW2")
.addQueryParam("hypervisor", "xen")
.addQueryParam("url", "http%3A//example.com/")
.addQueryParam("url", "http://example.com/")
.addQueryParam("zoneid", "20")
.addQueryParam("account", "mydomain")
.addQueryParam("domainid", "3")
@ -381,7 +381,7 @@ public class TemplateApiTest extends BaseCloudStackApiTest<TemplateApi> {
.addQueryParam("id", "3")
.addQueryParam("mode", "HTTP_DOWNLOAD")
.addQueryParam("zoneid", "5")
.addQueryParam("url", "http%3A//example.com/").build();
.addQueryParam("url", "http://example.com/").build();
public void testExtractTemplateOptions() throws NoSuchMethodException {
Invokable<?, ?> method = method(TemplateApi.class, "extractTemplate", String.class, ExtractMode.class, String.class, ExtractTemplateOptions[].class);

View File

@ -56,7 +56,12 @@ public class VirtualMachineApiExpectTest extends BaseCloudStackExpectTest<Virtua
VirtualMachineApi client = requestSendsResponse(
HttpRequest.builder().method("GET")
.endpoint("http://localhost:8080/client/api?response=json&command=getVMPassword&id=1&apiKey=identity&signature=SVA2r1KRj4yG03rATMLPZWS%2BKnw%3D")
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "getVMPassword")
.addQueryParam("id", "1")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "SVA2r1KRj4yG03rATMLPZWS+Knw=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -85,7 +90,7 @@ public class VirtualMachineApiExpectTest extends BaseCloudStackExpectTest<Virtua
.addQueryParam("serviceofferingid", "serviceOffering1")
.addQueryParam("templateid", "template1")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "pBjjnTq7/ezN94Uj0gpy2T//cJQ%3D")
.addQueryParam("signature", "pBjjnTq7/ezN94Uj0gpy2T//cJQ=")
.addHeader("Accept", "application/json")
.build();

View File

@ -18,8 +18,6 @@ package org.jclouds.cloudstack.features;
import static org.testng.Assert.assertEquals;
import java.net.URI;
import org.jclouds.cloudstack.CloudStackContext;
import org.jclouds.cloudstack.domain.NetworkType;
import org.jclouds.cloudstack.domain.Tag;
@ -46,7 +44,7 @@ public class ZoneApiExpectTest extends BaseCloudStackExpectTest<ZoneApi> {
.addQueryParam("command", "listZones")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "8iHCtck0qfxFTqJ8reyAObRf31I%3D")
.addQueryParam("signature", "8iHCtck0qfxFTqJ8reyAObRf31I=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
@ -82,9 +80,12 @@ public class ZoneApiExpectTest extends BaseCloudStackExpectTest<ZoneApi> {
ZoneApi client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=listZones&listAll=true&apiKey=identity&signature=8iHCtck0qfxFTqJ8reyAObRf31I%3D"))
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listZones")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "8iHCtck0qfxFTqJ8reyAObRf31I=")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()

View File

@ -38,7 +38,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("listAll", "true")
.addQueryParam("templatefilter", "executable")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "Xk6lF/v3SbhrxTKqaC2IWoBPKHo%3D")
.addQueryParam("signature", "Xk6lF/v3SbhrxTKqaC2IWoBPKHo=")
.addHeader("Accept", "application/json")
.build();
@ -55,7 +55,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("account", "jclouds")
.addQueryParam("domainid", "457")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "yAx1XbtjeEhdBQCNP0OLyWWAFCw%3D")
.addQueryParam("signature", "yAx1XbtjeEhdBQCNP0OLyWWAFCw=")
.addHeader("Accept", "application/json")
.build();
@ -68,7 +68,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("command", "listOsTypes")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "8BsE8MsOAhUzo1Q4Y3UD/e96u84%3D")
.addQueryParam("signature", "8BsE8MsOAhUzo1Q4Y3UD/e96u84=")
.addHeader("Accept", "application/json")
.build();
@ -82,7 +82,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("command", "listOsCategories")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "OojW4ssh/RQ3CubAzXue4svlofM%3D")
.addQueryParam("signature", "OojW4ssh/RQ3CubAzXue4svlofM=")
// .addHeader("Accept", "application/json") //TODO: why are we not passing this?
.build();
@ -96,7 +96,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("command", "listZones")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "GTUgn/LHDioJRq48kurOdCAYueo%3D")
.addQueryParam("signature", "GTUgn/LHDioJRq48kurOdCAYueo=")
.addHeader("Accept", "application/json")
.build();
@ -110,7 +110,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("command", "listServiceOfferings")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "jUien8oeEan7bjKKQbBlzvFuMjw%3D")
.addQueryParam("signature", "jUien8oeEan7bjKKQbBlzvFuMjw=")
.addHeader("Accept", "application/json")
.build();
@ -124,7 +124,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("command", "listAccounts")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "E4wuKXCkioaNIiL8hL8FD9K5K2c%3D")
.addQueryParam("signature", "E4wuKXCkioaNIiL8hL8FD9K5K2c=")
.addHeader("Accept", "application/json")
.build();
@ -140,7 +140,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("account", "jclouds") // account and domain came from above
.addQueryParam("domainid", "457")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "FDiGGBiG/sVj0k6DmZIgMNU8SqI%3D")
.addQueryParam("signature", "FDiGGBiG/sVj0k6DmZIgMNU8SqI=")
.addHeader("Accept", "application/json")
.build();
@ -159,7 +159,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("listAll", "true")
.addQueryParam("id", "1")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "q5GMO9iUYIFs5S58DdAuYAy8yu0%3D")
.addQueryParam("signature", "q5GMO9iUYIFs5S58DdAuYAy8yu0=")
.addHeader("Accept", "application/json")
.build();
@ -174,7 +174,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("listAll", "true")
.addQueryParam("id", "2")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "FnYX25207fVLLRz5GhOfRrWuUek%3D")
.addQueryParam("signature", "FnYX25207fVLLRz5GhOfRrWuUek=")
.addHeader("Accept", "application/json")
.build();
@ -188,7 +188,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("listAll", "true")
.addQueryParam("command", "listCapabilities")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "vVdhtet/zG59FXgkYkAzEQQ4q1o%3D")
.addQueryParam("signature", "vVdhtet/zG59FXgkYkAzEQQ4q1o=")
.addHeader("Accept", "application/json")
.build();
@ -203,7 +203,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("listAll", "true")
.addQueryParam("securitygroupname", "jclouds-test")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "zGp2rfHY6fBIGkgODRxyNzFfPFI%3D")
.addQueryParam("signature", "zGp2rfHY6fBIGkgODRxyNzFfPFI=")
.addHeader("Accept", "application/json")
.build();
@ -217,7 +217,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("command", "createSecurityGroup")
.addQueryParam("name", "jclouds-test")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "BdgmqGsvjPmP4PxsEKEpq6buwuA%3D")
.addQueryParam("signature", "BdgmqGsvjPmP4PxsEKEpq6buwuA=")
.addHeader("Accept", "application/json")
.build();
@ -235,7 +235,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("endport", "22")
.addQueryParam("cidrlist", "0.0.0.0/0")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "GVtXzAl/Q7z4wnvKEHtdV0lxv2o%3D")
.addQueryParam("signature", "GVtXzAl/Q7z4wnvKEHtdV0lxv2o=")
.addHeader("Accept", "application/json")
.build();
@ -249,7 +249,7 @@ public abstract class BaseCloudStackComputeServiceContextExpectTest<T> extends B
.addQueryParam("command", "createSSHKeyPair")
.addQueryParam("name", "jclouds-test")
.addQueryParam("apiKey", "APIKEY")
.addQueryParam("signature", "er6YjvUjPFwxy/x/aAVNW9Z8yo8%3D")
.addQueryParam("signature", "er6YjvUjPFwxy/x/aAVNW9Z8yo8=")
.addHeader("Accept", "application/json")
.build();