From 8ad3955e36d4ef0c053773ee67e769dc276b1aa3 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 25 Feb 2010 13:32:34 -0800 Subject: [PATCH] example of testing request signing --- .../test/java/org/jclouds/aws/s3/S3AsyncClientTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/core/src/test/java/org/jclouds/aws/s3/S3AsyncClientTest.java b/aws/core/src/test/java/org/jclouds/aws/s3/S3AsyncClientTest.java index 83e5a03b4d..7bb7761f08 100644 --- a/aws/core/src/test/java/org/jclouds/aws/s3/S3AsyncClientTest.java +++ b/aws/core/src/test/java/org/jclouds/aws/s3/S3AsyncClientTest.java @@ -100,6 +100,13 @@ public class S3AsyncClientTest extends RestClientTest { assertHeadersEqual(httpMethod, "Host: bucket.stub\n"); assertPayloadEquals(httpMethod, null); + filter.filter(httpMethod); + + assertRequestLineEquals(httpMethod, "GET http://bucket.stub:8080/?location HTTP/1.1"); + assertHeadersEqual(httpMethod, + "Authorization: AWS user:mlDjMMEYSR8md0v9S0JOZSoqWSA=\nDate: timestamp\nHost: bucket.stub\n"); + assertPayloadEquals(httpMethod, null); + assertResponseParserClassEquals(method, httpMethod, ParseSax.class); assertSaxResponseParserClassEquals(method, LocationConstraintHandler.class); assertExceptionParserClassEquals(method, null); @@ -506,6 +513,7 @@ public class S3AsyncClientTest extends RestClientTest { } BlobToObject blobToS3Object; + RequestAuthorizeSignature filter; @Override protected void checkFilters(GeneratedHttpRequest httpMethod) { @@ -524,6 +532,7 @@ public class S3AsyncClientTest extends RestClientTest { protected void setupFactory() { super.setupFactory(); blobToS3Object = injector.getInstance(BlobToObject.class); + filter = injector.getInstance(RequestAuthorizeSignature.class); } @Override