MockWebServer server = new MockWebServer();
server.enqueue(new MockResponse().setBody("").addHeader(ETAG, "ABCDEF"));
server.play();
S3Client client = getS3Client(server.getUrl("/"));
S3Object fileInDir = client.newS3Object();
fileInDir.getMetadata().setKey("someDir/fileName");
fileInDir.setPayload(new byte[] { 1, 2, 3, 4 });
assertEquals(client.putObject("bucket", fileInDir), "ABCDEF");
RecordedRequest request = server.takeRequest();
assertEquals(request.getRequestLine(), "PUT /bucket/someDir/fileName HTTP/1.1");