mirror of https://github.com/apache/jclouds.git
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:
parent
0c36b36d35
commit
f1a397359a
|
@ -119,7 +119,6 @@ public class GlacierClientMockTest {
|
||||||
@BeforeMethod
|
@BeforeMethod
|
||||||
private void initServer() throws IOException {
|
private void initServer() throws IOException {
|
||||||
server = new MockWebServer();
|
server = new MockWebServer();
|
||||||
server.setBodyLimit(0);
|
|
||||||
server.play();
|
server.play();
|
||||||
client = getGlacierClient(server.getUrl("/"));
|
client = getGlacierClient(server.getUrl("/"));
|
||||||
}
|
}
|
||||||
|
@ -256,6 +255,8 @@ public class GlacierClientMockTest {
|
||||||
// TODO: Change size to 4096 when moving to JDK 7
|
// TODO: Change size to 4096 when moving to JDK 7
|
||||||
@Test
|
@Test
|
||||||
public void testUploadPartMaxSize() throws InterruptedException {
|
public void testUploadPartMaxSize() throws InterruptedException {
|
||||||
|
// force the server to discard the request body
|
||||||
|
server.setBodyLimit(0);
|
||||||
MockResponse mr = buildBaseResponse(204);
|
MockResponse mr = buildBaseResponse(204);
|
||||||
mr.addHeader(GlacierHeaders.TREE_HASH, TREEHASH);
|
mr.addHeader(GlacierHeaders.TREE_HASH, TREEHASH);
|
||||||
server.enqueue(mr);
|
server.enqueue(mr);
|
||||||
|
|
Loading…
Reference in New Issue