public void testFilterWhenResponseIs2xx() {
HttpResponse filterResponse = HttpResponse.builder().statusCode(200)
.payload(payloadFromResourceWithContentType("/describe_spot_instance.xml", "text/xml")).build();
AWSEC2Api apiWhenExist = requestsSendResponses(describeRegionsRequest, describeRegionsResponse, filter, filterResponse)
.getContext().unwrapApi(AWSEC2Api.class);
SpotInstanceRequest request = getOnlyElement(apiWhenExist.getSpotInstanceApi().get().describeSpotInstanceRequestsInRegionWithFilter("us-east-1",
ImmutableMultimap.<String, String>builder()
.put("instance-id", "i-ef308e8e")
.build()));
assertEquals(request.getId(), "sir-1ede0012");