HttpClientTests: Open OutputStream in try-with-resource

Change-Id: Ib690b0af6d562765f43ad54d3855200a17eaa90b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-08-24 11:20:59 +09:00
parent 3f8b9cb5fa
commit 3151bc33ea
1 changed files with 6 additions and 6 deletions

View File

@ -419,12 +419,12 @@ public void testV2HttpSubsequentResponse() throws Exception {
// properly. Tests for other commands go in
// UploadPackTest.java.
OutputStream os = c.getOutputStream();
PacketLineOut pckOut = new PacketLineOut(os);
pckOut.writeString("command=ls-refs");
pckOut.writeDelim();
pckOut.end();
os.close();
try (OutputStream os = c.getOutputStream()) {
PacketLineOut pckOut = new PacketLineOut(os);
pckOut.writeString("command=ls-refs");
pckOut.writeDelim();
pckOut.end();
}
PacketLineIn pckIn = new PacketLineIn(c.getInputStream());