Skip to content
Permalink
Browse files
JCLOUDS-457: limit body size for specific test
For each test, we were forcing the server to discard the content of
the request body on @BeforeMethod. We need to do this on tests with a
huge body, but it may interfere with other tests which actually use
the body data.  To fix this problem, we moved the body limit
restriction to the tests that require it.
  • Loading branch information
rcoedo authored and gaul committed Jun 26, 2014
1 parent 23f391d commit bce335a2148652d38bb3dac2e976ddca9871096b
Showing 1 changed file with 2 additions and 1 deletion.
@@ -119,7 +119,6 @@ private static String getResponseBody(String path) throws IOException {
@BeforeMethod
private void initServer() throws IOException {
server = new MockWebServer();
server.setBodyLimit(0);
server.play();
client = getGlacierClient(server.getUrl("/"));
}
@@ -256,6 +255,8 @@ public void testUploadPart() throws InterruptedException {
// TODO: Change size to 4096 when moving to JDK 7
@Test
public void testUploadPartMaxSize() throws InterruptedException {
// force the server to discard the request body
server.setBodyLimit(0);
MockResponse mr = buildBaseResponse(204);
mr.addHeader(GlacierHeaders.TREE_HASH, TREEHASH);
server.enqueue(mr);

0 comments on commit bce335a

Please sign in to comment.