Issue #4400 - Review HttpClient's ContentProvider.
Review updates. Closing MultiPartRequestContent before sending it. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
708115f609
commit
e224be650b
|
@ -47,7 +47,6 @@ import static org.ops4j.pax.exam.CoreOptions.systemProperty;
|
|||
* top of this.
|
||||
*/
|
||||
@RunWith(PaxExam.class)
|
||||
|
||||
public class TestJettyOSGiBootWithAnnotations
|
||||
{
|
||||
private static final String LOG_LEVEL = "WARN";
|
||||
|
@ -135,6 +134,7 @@ public class TestJettyOSGiBootWithAnnotations
|
|||
TestOSGiUtil.assertContains("Response contents", content, "<h1>FRAGMENT</h1>");
|
||||
MultiPartRequestContent multiPart = new MultiPartRequestContent();
|
||||
multiPart.addFieldPart("field", new StringRequestContent("foo"), null);
|
||||
multiPart.close();
|
||||
response = client.newRequest("http://127.0.0.1:" + port + "/multi").method("POST")
|
||||
.body(multiPart).send();
|
||||
assertEquals(HttpStatus.OK_200, response.getStatus());
|
||||
|
|
|
@ -267,6 +267,7 @@ public class HugeResourceTest
|
|||
Path inputFile = staticBase.resolve(filename);
|
||||
String name = String.format("file-%d", expectedSize);
|
||||
multipart.addFilePart(name, filename, new PathRequestContent(inputFile), null);
|
||||
multipart.close();
|
||||
|
||||
URI destUri = server.getURI().resolve("/multipart");
|
||||
client.setIdleTimeout(90_000);
|
||||
|
|
Loading…
Reference in New Issue