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.
This commit is contained in:
Roman C. Coedo 2014-06-26 22:40:56 +02:00 committed by Andrew Gaul
parent 0c36b36d35
commit f1a397359a
1 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,6 @@ public class GlacierClientMockTest {
@BeforeMethod
private void initServer() throws IOException {
server = new MockWebServer();
server.setBodyLimit(0);
server.play();
client = getGlacierClient(server.getUrl("/"));
}
@ -256,6 +255,8 @@ public class GlacierClientMockTest {
// 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);