[GitHub] [jclouds] didixith commented on issue #47: J clouds 1516
didixith commented on issue #47: J clouds 1516 URL: https://github.com/apache/jclouds/pull/47#issuecomment-543144142 Let me know how to mock webserver response? Please check the below code and let me know your views on this. public void testCreateBucketNonDefaultRegion() throws IOException, InterruptedException { MockWebServer server = new MockWebServer(); server.enqueue(new MockResponse().setBody("").addHeader("x-amz-bucket-region", "sa-east-1").addHeader("Host", "testbucketsaeasttest-sa-east-1")); server.play(); S3Client client = getS3Client(server.getUrl("/")); assertTrue(client.putBucketInRegion(Region.US_EAST_1, "testbucketsaeasttest")); RecordedRequest request = server.takeRequest(); server.shutdown(); } This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [jclouds] didixith commented on issue #47: J clouds 1516
didixith commented on issue #47: J clouds 1516 URL: https://github.com/apache/jclouds/pull/47#issuecomment-540608524 Let me know, your inputs on this. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [jclouds] didixith commented on issue #47: J clouds 1516
didixith commented on issue #47: J clouds 1516 URL: https://github.com/apache/jclouds/pull/47#issuecomment-540507399 I am not seeing required headers in the request.. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [jclouds] didixith commented on issue #47: J clouds 1516
didixith commented on issue #47: J clouds 1516 URL: https://github.com/apache/jclouds/pull/47#issuecomment-540507240 public void testCreateBucketNonDefaultRegion() throws IOException, InterruptedException { MockWebServer server = new MockWebServer(); server.enqueue(new MockResponse().setBody("").addHeader("x-amz-bucket-region", "sa-east-1").addHeader("Host", "testbucketsaeasttest-sa-east-1")); server.play(); S3Client client = getS3Client(server.getUrl("/")); assertTrue(client.putBucketInRegion(Region.US_EAST_1, "testbucketsaeasttest")); RecordedRequest request = server.takeRequest(); server.shutdown(); } I have written this and output shows as below: Oct 10, 2019 3:55:59 PM com.squareup.okhttp.mockwebserver.MockWebServer$2 execute INFO: MockWebServer[51389] starting to accept connections Oct 10, 2019 3:56:00 PM com.squareup.okhttp.mockwebserver.MockWebServer$3 processOneRequest INFO: MockWebServer[51389] received request: PUT /testbucketsaeasttest HTTP/1.1 and responded: HTTP/1.1 200 OK PUT /testbucketsaeasttest HTTP/1.1 Accept: */* User-Agent: jclouds/2.0.1 java/1.8.0_181 Date: Thu, 10 Oct 2019 10:26:00 GMT Authorization: AWS AKIAIGKQ7V52FQQJFYJQ:KnOIQRd7WPASMopLKYMFjh2hB2M= Content-Length: 0 Host: localhost:51389 Connection: Keep-Alive Accept-Encoding: gzip Oct 10, 2019 3:56:01 PM com.squareup.okhttp.mockwebserver.MockWebServer$2 acceptConnections INFO: MockWebServer[51389] done accepting connections: Socket closed I want to know ideally : PUT /testbucketsaeasttest HTTP/1.1 should have region also appended with it. I want your inputs here, is this right flow or need changes? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [jclouds] didixith commented on issue #47: J clouds 1516
didixith commented on issue #47: J clouds 1516 URL: https://github.com/apache/jclouds/pull/47#issuecomment-540307333 Can you give more information : Whether I need to mock the request and response both? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services