diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/binders/BindBlockDeviceMappingToIndexedFormParams.java b/apis/ec2/src/main/java/org/jclouds/ec2/binders/BindBlockDeviceMappingToIndexedFormParams.java index cde7812ebd..4a55bffbd4 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/binders/BindBlockDeviceMappingToIndexedFormParams.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/binders/BindBlockDeviceMappingToIndexedFormParams.java @@ -21,6 +21,8 @@ package org.jclouds.ec2.binders; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static java.lang.String.format; +import static org.jclouds.http.utils.Queries.queryParser; +import static org.jclouds.io.Payloads.newUrlEncodedFormPayload; import java.util.Map; import java.util.Map.Entry; @@ -29,9 +31,8 @@ import org.jclouds.ec2.domain.BlockDevice; import org.jclouds.http.HttpRequest; import org.jclouds.rest.Binder; -import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; -import com.google.common.collect.Multimaps; /** * @author Oleksiy Yarmula @@ -40,28 +41,29 @@ import com.google.common.collect.Multimaps; public class BindBlockDeviceMappingToIndexedFormParams implements Binder { private static final String deviceNamePattern = "BlockDeviceMapping.%d.DeviceName"; - private static final String volumeIdPattern = "BlockDeviceMapping.%d.Ebs.VolumeId"; private static final String deleteOnTerminationPattern = "BlockDeviceMapping.%d.Ebs.DeleteOnTermination"; + private static final String volumeIdPattern = "BlockDeviceMapping.%d.Ebs.VolumeId"; @SuppressWarnings("unchecked") @Override public R bindToRequest(R request, Object input) { checkArgument(checkNotNull(input, "input") instanceof Map, "this binder is only valid for Map"); Map blockDeviceMapping = (Map) input; - - ImmutableMap.Builder builder = ImmutableMap.builder(); + Multimap original = queryParser().apply(request.getPayload().getRawContent().toString()); + ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); + builder.putAll("Action", "ModifyInstanceAttribute"); int amazonOneBasedIndex = 1; // according to docs, counters must start with 1 for (Entry ebsBlockDeviceName : blockDeviceMapping.entrySet()) { // not null by contract - builder.put(format(volumeIdPattern, amazonOneBasedIndex), ebsBlockDeviceName.getValue().getVolumeId()); builder.put(format(deviceNamePattern, amazonOneBasedIndex), ebsBlockDeviceName.getKey()); builder.put(format(deleteOnTerminationPattern, amazonOneBasedIndex), String.valueOf(ebsBlockDeviceName.getValue().isDeleteOnTermination())); - + builder.put(format(volumeIdPattern, amazonOneBasedIndex), ebsBlockDeviceName.getValue().getVolumeId()); amazonOneBasedIndex++; } - Multimap forms = Multimaps.forMap(builder.build()); - return forms.size() == 0 ? request : (R) request.toBuilder().replaceFormParams(forms).build(); + builder.putAll("InstanceId", original.get("InstanceId")); + request.setPayload(newUrlEncodedFormPayload(builder.build())); + return request; } } diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/binders/BindBlockDeviceMappingToIndexedFormParamsTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/binders/BindBlockDeviceMappingToIndexedFormParamsTest.java index 12ccf98a5e..356b6ed9f4 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/binders/BindBlockDeviceMappingToIndexedFormParamsTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/binders/BindBlockDeviceMappingToIndexedFormParamsTest.java @@ -44,17 +44,18 @@ public class BindBlockDeviceMappingToIndexedFormParamsTest { BindBlockDeviceMappingToIndexedFormParams binder = injector .getInstance(BindBlockDeviceMappingToIndexedFormParams.class); - public void testMapping() { + public void testMappingOrdersLexicographically() { Map mapping = Maps.newLinkedHashMap(); mapping.put("apple", new BlockDevice("appleId", true)); Date date = new Date(999999l); mapping.put("cranberry", new BlockDevice("cranberry", Status.ATTACHED, date, false)); - HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost").build(); + HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost") + .addFormParam("InstanceId", "i-foo").build(); request = binder.bindToRequest(request, mapping); assertEquals( request.getPayload().getRawContent(), - "BlockDeviceMapping.1.Ebs.VolumeId=appleId&BlockDeviceMapping.1.DeviceName=apple&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true&BlockDeviceMapping.2.Ebs.VolumeId=cranberry&BlockDeviceMapping.2.DeviceName=cranberry&BlockDeviceMapping.2.Ebs.DeleteOnTermination=false"); + "Action=ModifyInstanceAttribute&BlockDeviceMapping.1.DeviceName=apple&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true&BlockDeviceMapping.1.Ebs.VolumeId=appleId&BlockDeviceMapping.2.DeviceName=cranberry&BlockDeviceMapping.2.Ebs.DeleteOnTermination=false&BlockDeviceMapping.2.Ebs.VolumeId=cranberry&InstanceId=i-foo"); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/services/InstanceAsyncClientTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/services/InstanceAsyncClientTest.java index a6a5aca2ee..1b8d8148cd 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/services/InstanceAsyncClientTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/services/InstanceAsyncClientTest.java @@ -547,6 +547,15 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest method = method(InstanceAsyncClient.class, "setBlockDeviceMappingForInstanceInRegion", String.class, @@ -556,20 +565,13 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest newArrayList(null, "1", mapping)); + request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request); + assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1"); assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n"); - assertPayloadEquals( - request, - "Action=ModifyInstanceAttribute&InstanceId=1&BlockDeviceMapping.1.Ebs.VolumeId=vol-test1&BlockDeviceMapping.1.DeviceName=/dev/sda1&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true", - "application/x-www-form-urlencoded", false); - filter.filter(request);// ensure encoding worked properly - assertPayloadEquals( - request, - "Action=ModifyInstanceAttribute&BlockDeviceMapping.1.DeviceName=/dev/sda1&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true&BlockDeviceMapping.1.Ebs.VolumeId=vol-test1&InstanceId=1&Signature=RwY8lVPHSQxQkd5efUKccHdSTkN4OxMIMFiYAe3rrUE%3D&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2009-11-08T15%3A54%3A08.897Z&Version=2010-06-15&AWSAccessKeyId=identity", - "application/x-www-form-urlencoded", false); - assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class); - assertSaxResponseParserClassEquals(method, null); - assertFallbackClassEquals(method, null); + assertPayloadEquals(request, filter.filter(setBlockDeviceMapping).getPayload().getRawContent().toString(), + "application/x-www-form-urlencoded", false); + checkFilters(request); } diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2AsyncClient.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2AsyncClient.java index b3ce640953..a20a5dc599 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2AsyncClient.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2AsyncClient.java @@ -34,7 +34,7 @@ import org.jclouds.rest.annotations.Delegate; * @author Adrian Cole */ public interface AWSEC2AsyncClient extends EC2AsyncClient { - public static final String VERSION = "2011-05-15"; + public static final String VERSION = "2012-06-01"; /** * {@inheritDoc} diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/AWSAMIAsyncClientTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/AWSAMIAsyncClientTest.java index 5fad0ddc19..27bcd113d1 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/AWSAMIAsyncClientTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/AWSAMIAsyncClientTest.java @@ -59,13 +59,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "createImageInRegion", String.class, String.class, String.class, @@ -76,7 +70,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "createImageInRegion", String.class, String.class, String.class, @@ -110,7 +98,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "describeImagesInRegion", String.class, @@ -140,7 +122,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "describeImagesInRegion", String.class, @@ -176,7 +152,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "deregisterImageInRegion", String.class, String.class); @@ -206,7 +176,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "registerImageFromManifestInRegion", String.class, String.class, @@ -238,7 +202,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "registerImageFromManifestInRegion", String.class, String.class, @@ -271,8 +229,8 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "registerUnixImageBackedByEbsInRegion", String.class, @@ -305,7 +257,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "registerUnixImageBackedByEbsInRegion", String.class, @@ -348,8 +294,8 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "getBlockDeviceMappingsForImageInRegion", String.class, @@ -380,8 +320,8 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "getLaunchPermissionForImageInRegion", String.class, String.class); @@ -411,7 +345,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "addLaunchPermissionsToImageInRegion", String.class, @@ -448,7 +376,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "removeLaunchPermissionsFromImageInRegion", String.class, @@ -485,7 +407,7 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSAMIAsyncClient.class, "resetLaunchPermissionsOnImageInRegion", String.class, @@ -516,7 +432,8 @@ public class AWSAMIAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSInstanceAsyncClient.class, "setUserDataForInstanceInRegion", String.class, String.class, @@ -366,7 +360,7 @@ public class AWSInstanceAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSInstanceAsyncClient.class, "setRamdiskForInstanceInRegion", String.class, String.class, @@ -399,7 +387,7 @@ public class AWSInstanceAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSInstanceAsyncClient.class, "setKernelForInstanceInRegion", String.class, String.class, @@ -432,7 +414,7 @@ public class AWSInstanceAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSInstanceAsyncClient.class, "setInstanceTypeForInstanceInRegion", String.class, @@ -499,7 +469,7 @@ public class AWSInstanceAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSInstanceAsyncClient.class, "setBlockDeviceMappingForInstanceInRegion", String.class, @@ -551,14 +524,12 @@ public class AWSInstanceAsyncClientTest extends BaseAWSEC2AsyncClientTest mapping = Maps.newLinkedHashMap(); mapping.put("/dev/sda1", new BlockDevice("vol-test1", true)); GeneratedHttpRequest request = processor.createRequest(method, Lists. newArrayList(null, "1", mapping)); - - filter.filter(request); - + + request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request); + assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1"); assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n"); - assertPayloadEquals( - request, - "Action=ModifyInstanceAttribute&BlockDeviceMapping.1.DeviceName=/dev/sda1&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true&BlockDeviceMapping.1.Ebs.VolumeId=vol-test1&InstanceId=1&Signature=qqJpPk8UmhPY9Jica0JSADEZiY3eHf9WETm%2B5tLT0NE%3D&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2009-11-08T15%3A54%3A08.897Z&Version=2011-05-15&AWSAccessKeyId=identity", + assertPayloadEquals(request, filter.filter(setBlockDeviceMapping).getPayload().getRawContent().toString(), "application/x-www-form-urlencoded", false); assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class); diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/AWSKeyPairAsyncClientTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/AWSKeyPairAsyncClientTest.java index 270ca84132..c780fade3f 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/AWSKeyPairAsyncClientTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/AWSKeyPairAsyncClientTest.java @@ -63,13 +63,7 @@ public class AWSKeyPairAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSKeyPairAsyncClient.class, "importKeyPairInRegion", String.class, String.class, @@ -80,7 +74,7 @@ public class AWSKeyPairAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(AWSSecurityGroupAsyncClient.class, "createSecurityGroupInRegion", String.class, @@ -120,10 +114,10 @@ public class AWSSecurityGroupAsyncClientTest extends BaseAWSEC2AsyncClientTest newArrayList(null, "name", "description")); request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request); - + assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1"); assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n"); - assertPayloadEquals(request, createSecurityGroup.getPayload().getRawContent().toString(), + assertPayloadEquals(request, filter.filter(createSecurityGroup).getPayload().getRawContent().toString(), "application/x-www-form-urlencoded", false); assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class); diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/PlacementGroupAsyncClientTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/PlacementGroupAsyncClientTest.java index a2eb4a03ab..3eaba6060d 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/PlacementGroupAsyncClientTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/services/PlacementGroupAsyncClientTest.java @@ -64,13 +64,7 @@ public class PlacementGroupAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(PlacementGroupAsyncClient.class, "createPlacementGroupInRegion", String.class, @@ -81,7 +75,7 @@ public class PlacementGroupAsyncClientTest extends BaseAWSEC2AsyncClientTest { - HttpRequest requestSpotInstances = HttpRequest.builder().method("POST") - .endpoint("https://ec2.us-east-1.amazonaws.com/") - .addHeader("Host", "ec2.us-east-1.amazonaws.com") - .addFormParam("Action", "RequestSpotInstances") - .addFormParam("LaunchSpecification.ImageId", "m1.small") - .addFormParam("LaunchSpecification.InstanceType", "ami-voo") - .addFormParam("Signature", "5PZRT8xXMugx1ku/NxQpaGWqYLLbKwJksBbeldGLO2s=") - .addFormParam("SignatureMethod", "HmacSHA256") - .addFormParam("SignatureVersion", "2") - .addFormParam("SpotPrice", "0.01") - .addFormParam("Timestamp", "2009-11-08T15%3A54%3A08.897Z") - .addFormParam("Version", "2011-05-15") - .addFormParam("AWSAccessKeyId", "identity").build(); - - public void testRequestSpotInstance() throws SecurityException, NoSuchMethodException, IOException { - Invokable method = method(SpotInstanceAsyncClient.class, "requestSpotInstanceInRegion", String.class, - float.class, String.class, String.class); - GeneratedHttpRequest request = processor.createRequest(method, Lists. newArrayList(null, 0.01f, "m1.small", "ami-voo")); - - request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request); - - assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1"); - assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n"); - assertPayloadEquals(request, requestSpotInstances.getPayload().getRawContent().toString(), - "application/x-www-form-urlencoded", false); - - assertResponseParserClassEquals(method, request, ParseSax.class); - assertSaxResponseParserClassEquals(method, SpotInstanceHandler.class); - assertFallbackClassEquals(method, null); - - checkFilters(request); - } - - HttpRequest requestSpotInstancesOptions = HttpRequest.builder().method("POST") - .endpoint("https://ec2.us-east-1.amazonaws.com/") - .addHeader("Host", "ec2.us-east-1.amazonaws.com") - .addFormParam("Action", "RequestSpotInstances") - .addFormParam("AvailabilityZoneGroup", "availabilityZoneGroup") - .addFormParam("InstanceCount", "3") - .addFormParam("LaunchGroup", "launchGroup") - .addFormParam("LaunchSpecification.ImageId", "ami-voo") - .addFormParam("LaunchSpecification.InstanceType", "m1.small") - .addFormParam("LaunchSpecification.KernelId", "kernelId") - .addFormParam("LaunchSpecification.Placement.AvailabilityZone", "eu-west-1a") - .addFormParam("LaunchSpecification.SecurityGroup.1", "group1") - .addFormParam("Signature", "94pCsdmfYVMbMzofCeTvfvpQozIY6iDu0LewXvHl1ao=") - .addFormParam("SignatureMethod", "HmacSHA256") - .addFormParam("SignatureVersion", "2") - .addFormParam("SpotPrice", "0.01") - .addFormParam("Timestamp", "2009-11-08T15%3A54%3A08.897Z") - .addFormParam("ValidFrom", "1970-05-23T21%3A21%3A18Z") - .addFormParam("ValidUntil", "2009-02-13T23%3A31%3A31Z") - .addFormParam("Version", "2011-05-15") - .addFormParam("AWSAccessKeyId", "identity").build(); - - public void testRequestSpotInstancesOptions() throws SecurityException, NoSuchMethodException, IOException { - Invokable method = method(SpotInstanceAsyncClient.class, "requestSpotInstancesInRegion", String.class, - float.class, int.class, LaunchSpecification.class, RequestSpotInstancesOptions[].class); - GeneratedHttpRequest request = processor.createRequest(method, ImmutableList. of("eu-west-1", 0.01, 3, - LaunchSpecification.builder().instanceType("m1.small").imageId("ami-voo").availabilityZone("eu-west-1a") - .kernelId("kernelId").securityGroupName("group1").build(), new RequestSpotInstancesOptions().validFrom(from) - .validUntil(to).availabilityZoneGroup("availabilityZoneGroup").launchGroup("launchGroup"))); - - request = (GeneratedHttpRequest) request.getFilters().get(0).filter(request); - - assertRequestLineEquals(request, "POST https://ec2.eu-west-1.amazonaws.com/ HTTP/1.1"); - assertNonPayloadHeadersEqual(request, "Host: ec2.eu-west-1.amazonaws.com\n"); - assertPayloadEquals(request, requestSpotInstancesOptions.getPayload().getRawContent().toString(), - "application/x-www-form-urlencoded", false); - - assertResponseParserClassEquals(method, request, ParseSax.class); - assertSaxResponseParserClassEquals(method, SpotInstancesHandler.class); - assertFallbackClassEquals(method, null); - - checkFilters(request); - } - public void testCancelSpotInstanceRequests() throws SecurityException, NoSuchMethodException, IOException { Invokable method = method(SpotInstanceAsyncClient.class, "cancelSpotInstanceRequestsInRegion", String.class, String[].class); @@ -143,42 +60,6 @@ public class SpotInstanceAsyncClientTest extends BaseAWSEC2AsyncClientTest method = method(SpotInstanceAsyncClient.class, "describeSpotInstanceRequestsInRegion", String.class, - String[].class); - GeneratedHttpRequest request = processor.createRequest(method, Lists. newArrayList((String) null)); - - assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1"); - assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n"); - assertPayloadEquals(request, "Action=DescribeSpotInstanceRequests", - "application/x-www-form-urlencoded", false); - - assertResponseParserClassEquals(method, request, ParseSax.class); - assertSaxResponseParserClassEquals(method, SpotInstancesHandler.class); - assertFallbackClassEquals(method, EmptySetOnNotFoundOr404.class); - - checkFilters(request); - } - - public void testDescribeSpotInstanceRequestsArgs() throws SecurityException, NoSuchMethodException, IOException { - Invokable method = method(SpotInstanceAsyncClient.class, "describeSpotInstanceRequestsInRegion", String.class, - String[].class); - GeneratedHttpRequest request = processor.createRequest(method, Lists. newArrayList(null, "1", "2")); - - assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1"); - assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n"); - assertPayloadEquals( - request, - "Action=DescribeSpotInstanceRequests&SpotInstanceRequestId.1=1&SpotInstanceRequestId.2=2", - "application/x-www-form-urlencoded", false); - - assertResponseParserClassEquals(method, request, ParseSax.class); - assertSaxResponseParserClassEquals(method, SpotInstancesHandler.class); - assertFallbackClassEquals(method, EmptySetOnNotFoundOr404.class); - - checkFilters(request); - } - public void testDescribeSpotPriceHistory() throws SecurityException, NoSuchMethodException, IOException { Invokable method = method(SpotInstanceAsyncClient.class, "describeSpotPriceHistoryInRegion", String.class, DescribeSpotPriceHistoryOptions[].class);