How do you test S3 in a sandbox environment when your code uses an AmazonS3Client?
IAmazonS3 amazonS3Client =
Amazon.AWSClientFactory.CreateAmazonS3Client(s3AccessKey, s3SecretKey, config);
var request = new PutObjectRequest()
{
BucketName = "bucketname",
Key = "filename",
ContentType = "application/json",
ContentBody = "body"
};
amazonS3Client.PutObject(request);
I've tried S3Ninja and FakeS3 but they didn't work, which leads me to believe that an AmazonS3Client doesn't behave like a normal rest client.
The only solution I can think of is to convert the code to use a rest client and manually build the requests and headers just so that I can use S3Ninja or FakeS3.
Aucun commentaire:
Enregistrer un commentaire